Help making a button open another app with Java/Android
- by user569503
I am trying to learn to make a simple app that opens a couple of other apps to eliminate the need for another apps. I just can't figure it out. 
From reading here and other places it seems this should work. 
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);
Thanks so much for the help :D