title: How to make a button open another app with Java/Android?
body: <p>I am trying to learn to make a simple app that has a few buttons with each opening another app to eliminate the need for another apps. I just can't figure it out. Also, can I place more than one button in this activity to open another app? I can't really find that answer either. </p>
  
  <pre><code>Button batteryhistory = (Button)findViewById(R.string.BatteryHistoryButtonDialog);
  
      batteryhistory.setOnClickListener(new View.OnClickListener() {
  
        @Override
        public void onClick(View view) {
        Intent i = new Intent(); 
         ComponentName n = new 
         ComponentName("com.android.settings", 
         "com.android.settings.BatteryHistory"); 
         i.setComponent(n); 
         startActivity(i);
  </code></pre>
  
  <p>Thanks so much for the help :D</p>