2013-11-22 59 views
0

应用程序下面的代码完全在果冻豆的击打崩溃姜饼DEVELOPMENT_SETTINGS崩溃在姜饼

Intent i = new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS); 
startActivity(i); 
姜饼

是导致错误

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.APPLICATION_DEVELOPMENT_SETTINGS } 

有没有什么办法去开发设置在姜饼?

+0

oopss ..复制了错误的行。 :p –

回答

0

试试这个:

Intent i = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS); 
startActivity(i); 

希望这有助于。

+0

不,还是一样的问题 –

+0

选中这个:http://stackoverflow.com/questions/16001521/launch-location-settings-intent-from-preferences-xml-file –

0

试试这个..

Intent i = new Intent(android.provider.Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS); 
startActivity(i); 
1

您收到此异常,因为,因为没有活动可以处理姜饼

Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS 

意图的行动。当你用Intent动作启动任何Activity时,不要忘记验证是否有任何可以处理你的Intent动作的Activity。

看例子......)

Intent intent = new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS); 
    ComponentName componentName = intent.resolveActivity(getPackageManager()); 
    if (componentName == null) { 
     Toast.makeText(getApplicationContext(), "No Activity to handle Intent action", Toast.LENGTH_SHORT).show(); 
    } else { 
     startActivity(intent); 
    } 
+0

在android设置中有一个开发设置页面在姜饼。如果settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS不是正确的操作,我该如何转到该页面 –

+0

我在Gingerbread的设置中没有看到开发人员设置选项。你看过吗? –

+0

是的。它在设置>应用程序>开发人员。所以姜饼的行为是不同的。 –

0

尝试使用getApplicationContext(而不是mContext。

,或者使用

Intent i = new Intent(android.provider.Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS); 

startActivity(ⅰ);