I am trying to make a simple application which will send the user to a specific (system installed) app (system settings, calendar, browser, etc.) when clicked by the user fr
You have to make the call to LaunchComponent which can be done in onCreate first life-cycle callback function
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LaunchComponent (packageName, name);
}
updated
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
public class MainActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LaunchComponent ("com.sec.android.app.controlpanel", "abc?");
}
public void LaunchComponent (String packageName, String name){
Intent i = new Intent(Intent.ACTION_MAIN);
PackageManager manager = getPackageManager();
i = manager.getLaunchIntentForPackage(packageName);
i.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(i);
}