Hi, I have a problem when I call startActivity with some apps. This is
the exception:

java.lang.SecurityException: Permission Denial: starting Intent
{ action=android.intent.action.MAIN categories=
{android.intent.category.LAUNCHER} flags=0x10000000 comp=
{com.acquamedia.widget.translator/
com.acquamedia.widget.translator.TranslatorWidget} } from ProcessRecord
{43920440 1361:com.google.code.appsorganizer/10067} (pid=1361,
uid=10067) requires android.permission.INTERNET
at android.os.Parcel.readException(Parcel.java:1234)
at android.os.Parcel.readException(Parcel.java:1222)
at android.app.ActivityManagerProxy.startActivity
(ActivityManagerNative.java:1046)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:
1494)
at android.app.Activity.startActivityForResult(Activity.java:2669)
at android.app.Activity.startActivity(Activity.java:2713)

My app don't have the Internet Permission but I want to launch apps
with this permission.

For example I get this exception launching Mafia Lite with a code like
this:

public class MainActivity extends Activity {
        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                try {
                        String packageName = "mafia.free2.com";
                        String name = "mafia.free2.com.MafiaLife";
                        Intent intent = new Intent(Intent.ACTION_MAIN);
                        intent.addCategory(Intent.CATEGORY_LAUNCHER);
                        intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
                        intent.setClassName(packageName, name);
                        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        startActivity(intent);
                } catch (Throwable t) {
                        t.printStackTrace();
                }
        }
}

Someone have resolved this issue?
Many thanks, Fabio

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to