Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9156375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:45:45+00:00 2026-06-17T12:45:45+00:00

I am still learning the android apps development and after I started making a

  • 0

I am still learning the android apps development and after I started making a very simple app with google maps api v2 (not using it yet) when i run it on my Sony Xperia SL it says “Unfortunately myapp stopped”. The red msg’s in the LogCat are “Can’t open file for reading” (twice).

MainMenu.java

public class MainMenu extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main_menu);

    Button bntStart = (Button) findViewById(R.id.buttonStart);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(1, menu);
    return true;
}
}

MainActivity.java

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
}

}

activity_main_menu.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/menu_bg"
android:gravity="center_vertical"
android:orientation="vertical" >

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center" >

    <Button
        android:id="@+id/buttonStart"
        android:layout_width="80dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_margin="5dp"
        android:text="Start" />

    <Button
        android:id="@+id/buttonStop"
        android:layout_width="80dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_margin="5dp"
        android:text="Stop" />

</LinearLayout>

<Button
    android:id="@+id/buttonExit"
    android:layout_width="80dp"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:layout_margin="5dp"
    android:text="Exit" />

</LinearLayout>

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >

<fragment
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/map"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    class="com.google.android.gms.maps.MapFragment" />

</RelativeLayout>

manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="taxi.route"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="11"
    android:targetSdkVersion="16" />

<permission
    android:name="taxi.route.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />

<uses-permission android:name="taxi.route.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="taxi.route.MainMenu"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyCwPOMQ3LaE81JN3wdY6DvUi7EIJdn0q-I" />

    <activity
        android:name="taxi.route.MainActivity"
        android:label="activity_main" >
    </activity>
</application>

</manifest>

stack trace (i am not sure if thats the thingy)

01-20 17:48:32.129: D/dalvikvm(663): Late-enabling CheckJNI
01-20 17:48:32.399: D/TextLayoutCache(663): Using debug level: 0 - Debug Enabled: 0
01-20 17:48:32.459: D/libEGL(663): loaded /system/lib/egl/libGLES_android.so
01-20 17:48:32.469: D/libEGL(663): loaded /system/lib/egl/libEGL_adreno200.so
01-20 17:48:32.469: D/libEGL(663): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
01-20 17:48:32.469: D/libEGL(663): loaded /system/lib/egl/libGLESv2_adreno200.so
01-20 17:48:32.509: I/Adreno200-EGLSUB(663): <ConfigWindowMatch:2078>: Format RGBA_8888.
01-20 17:48:32.519: D/memalloc(663): /dev/pmem: Mapped buffer base:0x5c67c000 size:27111424 offset:23343104 fd:64
01-20 17:48:32.519: E/(663): Can't open file for reading
01-20 17:48:32.519: E/(663): Can't open file for reading
01-20 17:48:32.529: D/OpenGLRenderer(663): Enabling debug mode 0
01-20 17:48:32.529: W/ResourceType(663): No package identifier when getting value for resource number 0x00000001
01-20 17:48:32.529: D/AndroidRuntime(663): Shutting down VM
01-20 17:48:32.529: W/dalvikvm(663): threadid=1: thread exiting with uncaught exception (group=0x40aa8210)
01-20 17:48:32.529: E/AndroidRuntime(663): FATAL EXCEPTION: main
01-20 17:48:32.529: E/AndroidRuntime(663): android.content.res.Resources$NotFoundException: Resource ID #0x1
01-20 17:48:32.529: E/AndroidRuntime(663):  at android.content.res.Resources.getValue(Resources.java:1023)
01-20 17:48:32.529: E/AndroidRuntime(663):  at android.content.res.Resources.loadXmlResourceParser(Resources.java:2110)
01-20 17:48:32.529: E/AndroidRuntime(663):  at android.content.res.Resources.getLayout(Resources.java:862)
01-20 17:48:32.529: E/AndroidRuntime(663):  at android.view.MenuInflater.inflate(MenuInflater.java:92)
01-20 17:48:32.529: E/AndroidRuntime(663):  at taxi.route.MainMenu.onCreateOptionsMenu(MainMenu.java:21)
01-20 17:48:32.529: E/AndroidRuntime(663):  at android.app.Activity.onCreatePanelMenu(Activity.java:2444)
01-20 17:48:32.529: E/AndroidRuntime(663):  at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:392)
01-20 17:48:32.529: E/AndroidRuntime(663):  at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:743)
01-20 17:48:32.529: E/AndroidRuntime(663):  at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:2838)
01-20 17:48:32.529: E/AndroidRuntime(663):  at android.os.Handler.handleCallback(Handler.java:605)
01-20 17:48:32.529: E/AndroidRuntime(663):  at android.os.Handler.dispatchMessage(Handler.java:92)
01-20 17:48:32.529: E/AndroidRuntime(663):  at android.os.Looper.loop(Looper.java:137)
01-20 17:48:32.529: E/AndroidRuntime(663):  at android.app.ActivityThread.main(ActivityThread.java:4441)
01-20 17:48:32.529: E/AndroidRuntime(663):  at java.lang.reflect.Method.invokeNative(Native Method)
01-20 17:48:32.529: E/AndroidRuntime(663):  at java.lang.reflect.Method.invoke(Method.java:511)
01-20 17:48:32.529: E/AndroidRuntime(663):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:823)
01-20 17:48:32.529: E/AndroidRuntime(663):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)
01-20 17:48:32.529: E/AndroidRuntime(663):  at dalvik.system.NativeStart.main(Native Method)
01-20 17:48:35.009: I/Process(663): Sending signal. PID: 663 SIG: 9
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:45:47+00:00Added an answer on June 17, 2026 at 12:45 pm

    Most likely you’re facing a problem because of this line in MainMenu:

    getMenuInflater().inflate(1, menu);
    

    inflate() expects a resource ID pointing to an XML menu file, and a Menu object. However, 1 is almost certainly not a valid ID, resulting in an exception. Try passing in an ID to a Menu XML file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm still learning Java/Android development and I need some guidance to implement an Async
I am pretty new to Android Development and still learning some of the skills,
I have just started to program in Android and I am still learning. I
I have been learning android development and I am still new to this. I
I am still learning the Android API. Could someone give me some guidelines for
I'm doing my fyp in Android app and I'm still learning the whole deal,
I'm still learning Android Development so sorry if this question seems stupid but I'm
I've started work on an Android App that will work with Google Docs. UPDATE
I'm still in the process of learning how to make android apps. I'm currently
I am writing my first android app. So am still in the learning phase.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.