Posts

How To Make Android Tab Layout | change activity with left-right swipe | swipe screen

Image

How To Set Action Bar Logo | App Logo in Action Bar |

Image
public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setLogo(R.drawable.ic_launcher_background); getSupportActionBar().setDisplayUseLogoEnabled(true); } }

How To Make Navigation Drawer Using Default Navigation Drawer Activity

How To Make A Share Menu Item On Action Bar

Image
In order to add a share menu on action bar. First you needs to make a menu item, that i was showed in the previous post. Now according to previous post add this mymenu.xml file on your main java by below codes. Now you needs to make  onOptionsItemSelected method according to following code and handle the share option menu by using  Intent intent= new Intent(Intent. ACTION_SEND ); intent.setType( "text/plain" ); startActivity(Intent. createChooser (intent, "Share With" )); @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater menuInflater=getMenuInflater(); menuInflater.inflate(R.menu.mymenu,menu); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { if(item.getItemId()==R.id.shareID) { Intent intent=new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); startActivity(Intent.createCh...

How To Make Option Menu in Anddroid Studio | Making A Option Menu in Top Action Bar

Image
Step 01- Create A menu as mymenu.xml Step 01- Follow The Codes For MainActivity.Java public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater menuInflater=getMenuInflater(); menuInflater.inflate(R.menu.mymenu,menu); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { if(item.getItemId()==R.id.SettingId) { Toast.makeText(getApplicationContext(),"Setting is selected", Toast.LENGTH_LONG).show(); } if(item.getItemId()==R.id.ShareId) { Toast.makeText(getApplicationContext(),"Share is selected", T...

How To Make Android Splash Screen With Horizontal Progress Bar

Step 01: Splash Screen Activity XML Step 02: Splash Screen Activity JAVA public class SplashActivity extends AppCompatActivity { int progress; private ProgressBar progressBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //Remove Tile Bar requestWindowFeature(Window.FEATURE_NO_TITLE); //Remove Window bar getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN ); setContentView(R.layout.activity_splash); progressBar= (ProgressBar) findViewById(R.id.progressBarId); Thread thread=new Thread(new Runnable() { @Override public void run() { doWork(); startApp(); } }); thread.start(); } public void doWork() { for(progress=20;progress Step 03: Mai...

How To Make Android Progress Bar Action in Android Studio

Image
Step-01: First Make Progress Bar On Android MainActivity.XML Like Following.. Step-02: Now Write Some Java Code At MainActivity.Java public class MainActivity extends AppCompatActivity { int progress; private ProgressBar progressBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); progressBar= (ProgressBar) findViewById(R.id.progressBarId); Thread thread=new Thread(new Runnable() { @Override public void run() { doWork(); } }); thread.start(); } public void doWork() { for(progress=20;progress