java - Android - not accessible to landroid/app/instrumentation when extending application class -



java - Android - not accessible to landroid/app/instrumentation when extending application class -

im trying larn android ive run hang can't quite figure out. i'm trying work global variables. have extended application class. have added think right manifest (the name of class fortune crunch):

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.marctremblay.test.fortunecrunch" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" /> <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true" android:name=".fortunecrunch"> <activity android:name=".fortunecrunchactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application>

then have in fortunecrunchactivity.java file:

package com.marctremblay.test.fortunecrunch; import android.app.activity; import android.app.application; import android.content.res.resources; import android.os.bundle; import android.view.view; import android.widget.imageview; import android.widget.textview; class fortunecrunch extends application{ fortunecrunch() { } } class fortunecrunchactivity extends activity { /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); } }

i have removed code seek , class working sure issue isnt else. if remove android::name manifest no longer error.

here exact error

newinstance failed: lcom/marctremblay/test/fortunecrunch/fortunecrunch; not accessible landroid/app/instrumentation;

i stumped. have setup have seen in many examples. ideas appreciated! thanks.

try putting fortunecrunch class in own file, fortunecrunch.java, inside:

package com.marctremblay.test.fortunecrunch; import android.app.application; public class fortunecrunch extends application { @override public void oncreate() { super.oncreate(); // initialize variables here } }

java android

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -