我改了manifest之后程序意外终止

来源:互联网 发布:js继承机制 编辑:程序博客网 时间:2024/04/29 08:59

修改manifest主题为Theme.Light.NoTitleBar之后程序正常安装,但点击按钮却导致程序意外终止。

原因:各个按钮控件什么的定义的是private,权限不够,改成public后就可以了。。。

 

看网上例子

[Android UI界面]在manifest中加了Application name后,程序意外终止!

请教一下:
为什么在manifest中加了这个android:name=".MyApp",这个应用程序就意外终止了,提示:The Application XX has stopped unexpectedly.

Logcat:
02-25 03:21:48.806: DEBUG/dalvikvm(1352): newInstance failed: Lthree_Activities/com/MyApp; not accessible to Landroid/app/Instrumentation;

02-25 03:21:48.845: DEBUG/AndroidRuntime(1352): Shutting down VM

02-25 03:21:48.845: WARN/dalvikvm(1352): threadid=1: thread exiting with uncaught exception (group=0x40015560)

02-25 03:21:48.995: ERROR/AndroidRuntime(1352): FATAL EXCEPTION: main
....
....

没有写什么啊:
package three_Activities.lljl.com;

import android.app.Application;

class MyApp extends Application {
        private String myState;
        public String getState() {
                return myState;
        }
        public void setState(String s) {
                myState = s;
        }

}
 
你的MyApp的访问权限不够,现在是默认的private, 用public就可以了.

原创粉丝点击