2013年9月5日星期四

[ Novice learning ] Custom Application

Own definition of an Application class com.yigedou.app.Hello
package com.yigedou.helloworld;

import android.app.Application;
import android.util.Log;

public class Hello extends Application {
public static final int DISP_MAIN = 0;
public static final int DISP_MENU = 1;
@ Override
public void onCreate () {
super.onCreate () ;
Log.d ("Hello", "Application-Hello onCreate");
}
}

added to the manifest
android: name = "com . yigedou.app.Hello "
android: allowBackup =" true "
; android: icon = "@ drawable / ic_launcher"
android: label = "@ string / app_name"
android: theme = "@ style / AppTheme">


simulator results prompted a run stops unexpectedly
If you do not add the android: name = "com.yigedou.app.Hello" no problem using the system default

------ Solution ------------------------------------ --------
you put android: name = "com.yigedou.app.Hello" changed android: name = "com.yigedou.helloworld.Hello"
---- - For reference only ---------------------------------------
this android: name = aplication is your name, your package name package com.yigedou.helloworld, so the name is com.yigedou.helloworld.Hello
------ For reference only -------- -------------------------------
Thank you to solve it really was a veteran

没有评论:

发表评论