Open an application by Android code

// Open an aplication from your code application PackageManager packageManager = getPackageManager(); Intent intent = packageManager.getLaunchIntentForPackage("com.android.samp"); startActivity(intent); // Use the lines of code below to open an activity in other application Intent intent = new Intent(Intent.ACTION_MAIN); intent.setClassName("com.android.samp","com.android.samp.MainActivity"); startActivity(intent);
Simple snippet that shows how to open an application from your app and how to run a specific activity from other app.

#android #application

#cesarnog

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.