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 7807773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:57:28+00:00 2026-06-02T02:57:28+00:00

I want to add edit text above the mapview in android so I created

  • 0

I want to add edit text above the mapview in android
so I created this layout

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:id="@+id/base">

<EditText
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:id="@+id/zoomtext"
    >
</EditText>

<com.google.android.maps.MapView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mapview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clickable="true"
    android:apiKey="myAPIkey"
    android:layout_below="@+id/zoomtext"/>
</RelativeLayout>

here’s my java code

package zoom.map;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;

import android.os.Bundle;
import android.widget.EditText;

public class ZoomapActivity extends MapActivity {
EditText zoombtn;
int angkazoom;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    MapView mapView = (MapView) findViewById(R.id.mapview);
    mapView.setBuiltInZoomControls(true);
    zoombtn = (EditText) findViewById(R.id.zoomtext);
    angkazoom = mapView.getZoomLevel();
    zoombtn.setText(angkazoom);
}

@Override
protected boolean isRouteDisplayed() {
    // TODO Auto-generated method stub
    return false;
}
}

and this is my error log cat

04-18 13:08:37.230: E/AndroidRuntime(309): FATAL EXCEPTION: main
04-18 13:08:37.230: E/AndroidRuntime(309): java.lang.RuntimeException: Unable to start activity ComponentInfo{zoom.map/zoom.map.ZoomapActivity}:    android.content.res.Resources$NotFoundException: String resource ID #0x3
04-18 13:08:37.230: E/AndroidRuntime(309):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
04-18 13:08:37.230: E/AndroidRuntime(309):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-18 13:08:37.230: E/AndroidRuntime(309):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-18 13:08:37.230: E/AndroidRuntime(309):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-18 13:08:37.230: E/AndroidRuntime(309):  at android.os.Handler.dispatchMessage(Handler.java:99)
04-18 13:08:37.230: E/AndroidRuntime(309):  at android.os.Looper.loop(Looper.java:123)
04-18 13:08:37.230: E/AndroidRuntime(309):  at android.app.ActivityThread.main(ActivityThread.java:4627)
04-18 13:08:37.230: E/AndroidRuntime(309):  at java.lang.reflect.Method.invokeNative(Native Method)
04-18 13:08:37.230: E/AndroidRuntime(309):  at java.lang.reflect.Method.invoke(Method.java:521)
04-18 13:08:37.230: E/AndroidRuntime(309):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-18 13:08:37.230: E/AndroidRuntime(309):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-18 13:08:37.230: E/AndroidRuntime(309):  at dalvik.system.NativeStart.main(Native Method)
04-18 13:08:37.230: E/AndroidRuntime(309): Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x3
04-18 13:08:37.230: E/AndroidRuntime(309):  at android.content.res.Resources.getText(Resources.java:201)
04-18 13:08:37.230: E/AndroidRuntime(309):  at android.widget.TextView.setText(TextView.java:2817)
04-18 13:08:37.230: E/AndroidRuntime(309):  at zoom.map.ZoomapActivity.onCreate(ZoomapActivity.java:21)
04-18 13:08:37.230: E/AndroidRuntime(309):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-18 13:08:37.230: E/AndroidRuntime(309):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
04-18 13:08:37.230: E/AndroidRuntime(309):  ... 11 more

I can’t figure out what’s wrong..
No problem with the layout and I have no error in the java
I’ve searched through stackoverflow and haven’t found the answer yet..

  • 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-02T02:57:30+00:00Added an answer on June 2, 2026 at 2:57 am

    This line

    angkazoom = mapView.getZoomLevel();
    

    Is retrieving an integer value.

    When calling

    zoombtn.setText(angkazoom);
    

    android assumes you are trying to set your text to a String resource ID (an int).. This ID “should” map to a string value.. When it searches for that ID it fails since it doesn’t exist and causes your crash.

    If what you want to show is just the zoom level use

    zoombtn.setText(angkazoom + "");
    

    to allow your text to show the zoom level in string representation

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

Sidebar

Related Questions

I want to add a Relative Layout below a TextView and above a Button.
I am using C#.net I want to add custom edit/delete buttons to my GridView1
I want to add a new form to the edit customer page, so far
I have a edit in place section to which I want to add a
Dynamically I want to edit/update hosts(etc/hosts) file to add domain. To edit hosts(etc/hosts) file
I want add my custom sidebar next right column all page. Please check this
I have several places on the page where there is text Add This text
alt text http://img21.imageshack.us/img21/3262/snapshotosz.png I want to add a new tab or site in sharepoint
I want to display a combobox with add/edit dialog on Jqgrid. I could do
In C++: If I want to add 0x01 to the string text I would

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.