Sagar Zala
Sagar Zala

Reputation: 5134

Android app does not work on Tablet

I have created an android application, that doesn't run on Tablet.

I have added xml files in res/layout-large folder. When I run on emulator it's working but in Tablet it gives error like- Unfortunately xxx has stopped.

Logcat output:

java.lang.RuntimeException: Unable to start activity ComponentInfo{idev.android.soulspotter/idev.android.soulspotter.Login}: android.content.res.Resources$NotFoundException: Resource ID

0x7f030021

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) at android.app.ActivityThread.access$600(ActivityThread.java:123) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4424) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) at dalvik.system.NativeStart.main(Native Method) Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f030022 at android.content.res.Resources.getValue(Resources.java:1018) at android.content.res.Resources.loadXmlResourceParser(Resources.java:2105) at android.content.res.Resources.getLayout(Resources.java:857) at android.view.LayoutInflater.inflate(LayoutInflater.java:394) at android.view.LayoutInflater.inflate(LayoutInflater.java:352) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251) at android.app.Activity.setContentView(Activity.java:1862) at idev.android.soulspotter.Login.onCreate(Login.java:57) at android.app.Activity.performCreate(Activity.java:4492) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) ... 11 more

Please give me solution.

Upvotes: 1

Views: 1207

Answers (4)

Nirav Dabhi
Nirav Dabhi

Reputation: 343

Put all the xml files in same folder "Layout"

May be it work.

Upvotes: 1

Sagar Zala
Sagar Zala

Reputation: 5134

I put all the xml files in res/layout and my work is done.

Upvotes: 0

Ameer
Ameer

Reputation: 2769

1.in eclipse, go to Project > Clean… 2.select your project, then press OK 3.relaunch the app

if it happens again delete the r.java file. it will generate automatically.

ANd check names in all resources are matching and not capital letter. Also check your manifest

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

Upvotes: 0

matgod
matgod

Reputation: 49

Check all objects in your view - its position on the screen and dependency of other objects made in the same view.
I had same situation and after changing its position all aplication works properly .

Upvotes: 0

Related Questions