java.lang.RuntimeException的:无法实例活动 [英] java.lang.RuntimeException: Unable to instantiate activity

查看:131
本文介绍了java.lang.RuntimeException的:无法实例活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了一些设备采用Android 4.4像银河TAB3 8.0(lt01wifi)这个错误,如果你有此选项卡,请回复。 该应用程序工作得很好上的设备的其他部分。 请帮我!我遇到了很多不好的收视率。

I got this error from some devices with Android 4.4 like Galaxy Tab3 8.0 (lt01wifi) if you have this tab,please reply. The app works just fine on the rest of the devices. Please help me! i'm having a lot of bad ratings..

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{aladin888.dessin/aladin888.dessin.Splash}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2208)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2340)
at android.app.ActivityThread.access$800(ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5293)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at android.app.Activity.setRequestedOrientation(Activity.java:4453)

和我想不出哪来的问题。一切似乎是正确的(对我)的问题我manifest.The活动申请为你所看到的:

And i can't figure out where's the issue. everything seems to be correct (to me) in my manifest.The activity in question is registred as you can see:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="aladin888.dessin"
    android:versionCode="10"
    android:versionName="1.9.0" >

    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:resizeable="true"
        android:smallScreens="true" />

    <uses-sdk android:minSdkVersion="8" />

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
    <uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>    


    <application
        android:icon="@drawable/icon"
        android:label="@string/app_name" >
        <activity
            android:name="aladin888.dessin.Splash"
            android:label="@string/app_name"
            android:exported="true"
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" 
            android:configChanges="keyboard|keyboardHidden|orientation">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="aladin888.dessin.EasyPaint"
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
            <intent-filter>

            </intent-filter>
        </activity>


    <activity android:name="com.google.ads.AdActivity"
              android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
   </application>

</manifest>

感谢您的帮助Dawnkeeper!但我仍然有同样的问题,我得到了很多差评 任何更多的想法将是非常美联社preciated !!

Thank you for your help Dawnkeeper! but i'm still having the same issue, and i'm getting a lot bad ratings Any more ideas will be very appreciated!!

推荐答案

您在名称中引用包

 android:name="aladin888.dessin.Splash"

android:name=".Splash"

修改

当我们发现这并不是真正的问题。另一个提示是这样的:

As we found out this isn't really the problem. Another hint is this:

Caused by: java.lang.NullPointerException
at android.app.Activity.setRequestedOrientation(Activity.java:4453)

我搜索了一会儿,但无法找到具有这个方法在给定线的Andr​​oid版本。我发现了什么是这种方法并没有在一段时间改为:

I searched for a while, but could not find a android version that has this method at the given line. What I found out is that method has not changed in a while:

 public void setRequestedOrientation(int requestedOrientation) {
       if (mParent == null) {
           try {
                ActivityManagerNative.getDefault().setRequestedOrientation(
                        mToken, requestedOrientation);
            } catch (RemoteException e) {
                // Empty
            }
        } else {
            mParent.setRequestedOrientation(requestedOrientation);
        }
    }

我看到这个失败的唯一机会是当ActivityManagerNative.getDefault()返回null。我找不到任何针对此问题有帮助。

The only chance I see for this failing is when the ActivityManagerNative.getDefault() returns null. I couldn't find anything helpful for this issue.

这篇关于java.lang.RuntimeException的:无法实例活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆