Get this error wheni type the SECRET_CODE in.

D/AndroidRuntime(  686): Shutting down VM
W/dalvikvm(  686): threadid=3: thread exiting with uncaught exception
(group=0x4001b178)
E/AndroidRuntime(  686): Uncaught handler: thread main exiting due to
uncaught exception
E/AndroidRuntime(  686): java.lang.RuntimeException: Unable to start
receiver com.smactivity.SMPTBroadcastReciever:
android.util.AndroidRuntimeException: Calling startActivity() from
outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK
flag. Is this really what you want?
E/AndroidRuntime(  686):        at
android.app.ActivityThread.handleReceiver(ActivityThread.java:2646)
E/AndroidRuntime(  686):        at android.app.ActivityThread.access
$3100(ActivityThread.java:119)
E/AndroidRuntime(  686):        at android.app.ActivityThread
$H.handleMessage(ActivityThread.java:1913)
E/AndroidRuntime(  686):        at android.os.Handler.dispatchMessage
(Handler.java:99)
E/AndroidRuntime(  686):        at android.os.Looper.loop(Looper.java:
123)
E/AndroidRuntime(  686):        at android.app.ActivityThread.main
(ActivityThread.java:4363)
E/AndroidRuntime(  686):        at
java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  686):        at java.lang.reflect.Method.invoke
(Method.java:521)
E/AndroidRuntime(  686):        at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime(  686):        at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime(  686):        at dalvik.system.NativeStart.main
(Native Method)
E/AndroidRuntime(  686): Caused by:
android.util.AndroidRuntimeException: Calling startActivity() from
outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK
flag. Is this really what you want?
E/AndroidRuntime(  686):        at
android.app.ApplicationContext.startActivity(ApplicationContext.java:
550)
E/AndroidRuntime(  686):        at
android.content.ContextWrapper.startActivity(ContextWrapper.java:248)
E/AndroidRuntime(  686):        at
android.content.ContextWrapper.startActivity(ContextWrapper.java:248)
E/AndroidRuntime(  686):        at
com.smactivity.SMPTBroadcastReciever.onReceive
(SMPTBroadcastReciever.java:19)
E/AndroidRuntime(  686):        at
android.app.ActivityThread.handleReceiver(ActivityThread.java:2637)
E/AndroidRuntime(  686):        ... 10 more

using this code

public class SMPTBroadcastReciever extends BroadcastReceiver {

        @Override
        public void onReceive(Context context, Intent intent) {
                if(intent.getAction().equals(SECRET_CODE_ACTION)){
                        Intent i = new Intent(Intent.ACTION_MAIN);
                        i.setClass(context, SMActivity.class);
                        i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        context.startActivity(intent);
                }

        }

}

Anyone got idea's??

On 5 Jan, 11:07, Master_Ne0 <[email protected]>
wrote:
> Hi, been looking at the androidcodeand wanted to know if it was
> possible to use thesecretcodefor SDK applications or was it only
> reserved for system apps?
>
> System settings has this in the manifest
>
> <receiver android:name="TestingSettingsBroadcastReceiver">
>             <intent-filter>
>                  <action
> android:name="android.provider.Telephony.SECRET_CODE" />
>                  <data android:scheme="android_secret_code"
> android:host="4636" />
>             </intent-filter>
> </receiver>
>
> So when you dial *#*#4636#*#* it launches the testing settings
> activity. It would be very handy if we could use this.
>
> Ne0
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to