Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Cannot create MapView
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Farhan  
View profile  
 More options Nov 20 2007, 12:43 am
From: Farhan <russ...@gmail.com>
Date: Mon, 19 Nov 2007 21:43:57 -0800 (PST)
Local: Tues, Nov 20 2007 12:43 am
Subject: Cannot create MapView
I am trying to use MapView in a MapActivity. My view only has an
EditText and a MapView. But I am getting the following error while
trying to run it:

Binary XML line #13: Error inflating class MapView

Here is my XML layout file main.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
        <EditText id="@+id/location"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="Enter the location here"
            android:selectAllOnFocus="true"
            />
    <MapView id="@+id/mapv"
            android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        />
</LinearLayout>

Here is my only code file:

package com.russoue.testandroid;

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

import com.google.android.maps.MapActivity;

public class TestAndroid extends MapActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.main);
        EditText locationField = (EditText)
findViewById(R.id.location);
        locationField.setSelection(0,
locationField.getText().length());
    }

}

Can anyone help?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
prabhu.swaminathan@gmail. com  
View profile  
 More options Nov 20 2007, 7:42 am
From: "prabhu.swaminat...@gmail.com" <prabhu.swaminat...@gmail.com>
Date: Tue, 20 Nov 2007 04:42:03 -0800 (PST)
Local: Tues, Nov 20 2007 7:42 am
Subject: Re: Cannot create MapView
I havent tried thru Layout XML but did with coding.

Just create an instance of MapView and pass it to setCOntentView

        MapView mapView = new MapView(this);
        MapController mc = mapView.getController();
        mc.animateTo(p);
        mc.zoomTo(9);
        setContentView(mapView);

On Nov 20, 10:43 am, Farhan <russ...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Farhan  
View profile  
 More options Nov 20 2007, 11:46 am
From: Farhan <russ...@gmail.com>
Date: Tue, 20 Nov 2007 08:46:10 -0800 (PST)
Local: Tues, Nov 20 2007 11:46 am
Subject: Re: Cannot create MapView
Thanks Prabhu. My intention was to have a MapView with some other view
e.g. EditText in a LinearLayout. Though XML is better, as it is the
preferred way by Google, doing it programmatically would be fine for
me. I just want to combine MapView with something else in one view.

On Nov 20, 6:42 am, "prabhu.swaminat...@gmail.com"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
h.vdhielko@gmail.com  
View profile  
 More options Nov 20 2007, 12:01 pm
From: "h.vdhie...@gmail.com" <hie...@tweakers.net>
Date: Tue, 20 Nov 2007 09:01:54 -0800 (PST)
Local: Tues, Nov 20 2007 12:01 pm
Subject: Re: Cannot create MapView
If someone knows how to create a mapview with xml: let me know! I'm
can only create a working mapview by creating it directly in the code
using:

MapView mv = new MapView(this);
setContentView(mv);

On 20 nov, 17:46, Farhan <russ...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Farhan  
View profile  
 More options Nov 20 2007, 12:09 pm
From: Farhan <russ...@gmail.com>
Date: Tue, 20 Nov 2007 09:09:15 -0800 (PST)
Local: Tues, Nov 20 2007 12:09 pm
Subject: Re: Cannot create MapView
I guess we are missing something regarding creating a MapView by XML
or may be it is not possible. I am waiting for someone from Google to
clarify it.

On Nov 20, 11:01 am, "h.vdhie...@gmail.com" <hie...@tweakers.net>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
JuhaK  
View profile  
 More options Nov 23 2007, 2:12 am
From: JuhaK <juha.kervi...@gmail.com>
Date: Thu, 22 Nov 2007 23:12:35 -0800 (PST)
Local: Fri, Nov 23 2007 2:12 am
Subject: Re: Cannot create MapView
Hello,

This may or may not be relevant to your case of MapViews, but I was
getting a similar error when using XML to create EditText view. The
view xml was something like this:

<?xml version="1.0" encoding="UTF-8"?>
<view xmlns:android="http://schemas.android.com/apk/res/android"
        class="com.mytestmemo.editor.MemoEditor$MemoText"
        id="@+id/memo"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#ffffff"
        android:padding="10dip"
        android:scrollbars="vertical"
        android:fadingEdge="vertical"/>

Turned out I had mistyped the name of the inner class (was something
like MyMemoText rather than MemoText). The error was also clearly
shown in LogCat, where the root cause to the ViewInflate
$InflateException was ClassNotFoundException. Does the log show
anything informative in your case?

BR,

JuhaK

On 20 marras, 19:09, Farhan <russ...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jun Sunao Aoki  
View profile  
 More options Nov 23 2007, 2:48 am
From: Jun Sunao Aoki <jun.sunao.a...@gmail.com>
Date: Thu, 22 Nov 2007 23:48:53 -0800 (PST)
Local: Fri, Nov 23 2007 2:48 am
Subject: Re: Cannot create MapView
Hi JuhaK

Your example gives me an idea and that works!
Try the following code.

Then I have a question : MapView is a build-in class and why do we
have to write it in "class" attribute?
I assume that "class" attribute is for your own class. The build-in
class shoud have been written like "TextView".
Is this a bug?

----XML Layout(main.xml)----------------------------
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello World, JunMap" />
<EditText android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_weight="1" />
<view class="com.google.android.maps.MapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>

------------------------------------
package com.jun.test;

import android.os.Bundle;
import com.google.android.maps.MapView;
import com.google.android.maps.MapActivity;
import android.view.Menu;

public class JunMap extends MapActivity {

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);

}

On Nov 22, 11:12 pm, JuhaK <juha.kervi...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Farhan  
View profile  
 More options Nov 29 2007, 12:14 pm
From: Farhan <russ...@gmail.com>
Date: Thu, 29 Nov 2007 09:14:28 -0800 (PST)
Local: Thurs, Nov 29 2007 12:14 pm
Subject: Re: Cannot create MapView
Hello Juhak and Jun Sunao Aoki,

Thank you for the solution. It worked for me. I followed Juhak's xml
layout. I only used an EditText with the map. However, I have to
remove the "adroid_weight="1"" field to make the EditText visible. It
must be a bug that we cannot create MapView by the same way we create
other views. Or it may be an undocumented restriction. Lets wait for
Google's clarification on it.

Regards,
Farhan

On Nov 23, 1:48 am, Jun Sunao Aoki <jun.sunao.a...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »