1

i really don't know how to start this project.. or what to use.. fragments or views? If anybody can help me, would be really great.. i got this image here.. project image how can i do this ? i want to do this but i dont know how.. i will be here for any questions.. feel free to ask anything, if anybody can help me, would be really great.

public class MainActivity extends 
AppCompatActivity {

TextView ScrollTextView;

ImageView youtube;
View decorView;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    ScrollTextView= (TextView) findViewById(R.id.scrol_text);

    //fullscreen
     decorView = getWindow().getDecorView();
    final int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_FULLSCREEN
            | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
    decorView.setSystemUiVisibility(uiOptions);



youtube = findViewById(R.id.youtube);
youtube.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {



    FragmentManager fragmentManager = getFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    MyFragment fragment = new MyFragment();
    fragmentTransaction.add(R.id.my_fragment, fragment);
    fragmentTransaction.commit();
}
});

}

@Override
protected void onRestart() {
    super.onRestart();
    final int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_FULLSCREEN
            | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
    decorView.setSystemUiVisibility(uiOptions);
}

}

dodo4u
  • 11
  • 5
  • Does this answer your question? https://stackoverflow.com/questions/3872063/how-to-launch-an-activity-from-another-application-in-android – Aditya Kurkure May 20 '20 at 17:42
  • hi, nope...srry.. – dodo4u May 20 '20 at 17:55
  • So you don't want to launch youtube but display a youtube video in your app? – Aditya Kurkure May 20 '20 at 18:23
  • i want the user to seach on youtube... but if its not possible .. a playlist would be fine.. or trending clips.. – dodo4u May 20 '20 at 18:45
  • I'm sorry it's still not clear. You want the user to open the youtube app and search for something and then return to your app? – Aditya Kurkure May 20 '20 at 19:17
  • yes.. but my scrolling text view bar from left to right to remains there.. plus a back button to my first activity.. i want an app inside another app.. but to display the controlls of my first activity.. all the time.. – dodo4u May 20 '20 at 19:27

0 Answers0