activity and views problem

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

activity and views problem

Postby abdo19 » Sat Jan 16, 2010 9:32 am

Hi all,

I am traying to create an application that uses a menu and when I click in an item it should appear a map whith many markers in different positions .

I arrived to create the menu but, when I click on the item ,the application craches.
I am using right now this portion of code:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.     switch (item.getItemId()) {
  2.  
  3.  
  4.  
  5.                            case 0:
  6.  
  7.  
  8.  
  9.                                   startActivity(new Intent(this, Display_Map.class));
  10.  
  11.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


and I am using 2 xml files :

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4.  
  5.    android:orientation="vertical"
  6.  
  7.    android:layout_width="fill_parent"
  8.  
  9.    android:layout_height="fill_parent"
  10.  
  11.    >    
  12.  
  13. <TextView  
  14.  
  15.    android:layout_width="fill_parent"
  16.  
  17.    android:layout_height="wrap_content"
  18.  
  19.    android:text="Ecrire votre adreesse ici :"
  20.  
  21.    />
  22.  
  23. <EditText
  24.  
  25.         android:text="@+id/EditText01"
  26.  
  27.         android:id="@+id/EditText01"
  28.  
  29.         android:layout_width="wrap_content"
  30.  
  31.         android:layout_height="wrap_content"
  32.  
  33.         android:background="@android:drawable/editbox_background"
  34.  
  35.         android:singleLine="true"
  36.  
  37. />
  38.  
  39. </LinearLayout>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


and the second one:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4.  
  5.    android:orientation="vertical"
  6.  
  7.    android:layout_width="fill_parent"
  8.  
  9.    android:layout_height="fill_parent"
  10.  
  11.    >
  12.  
  13.    
  14.  
  15.     <view class="com.google.android.maps.MapView"
  16.  
  17.            android:id="@+id/myMapView"
  18.  
  19.          android:layout_width="fill_parent"
  20.  
  21.          android:layout_height="fill_parent"/>
  22.  
  23. </LinearLayout>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


did any one can show me the error.

please reply it is urgent.

thank you ...
abdo19
Freshman
Freshman
 
Posts: 7
Joined: Sun Oct 25, 2009 6:14 pm

Top

hi

Postby bingxuewangzi427 » Thu Jan 28, 2010 9:57 am

maybe you forgot to add permission of map
bingxuewangzi427
Developer
Developer
 
Posts: 38
Joined: Tue Jan 26, 2010 11:33 am

Postby abdo19 » Thu Jan 28, 2010 10:32 am

I made Permission in Manifest file

The problem is:

can I use startActivity(new Intent(this, Display_Map.class)) in which Display_Map is a MapActivity

can you help me
abdo19
Freshman
Freshman
 
Posts: 7
Joined: Sun Oct 25, 2009 6:14 pm

Postby naveenballa » Thu Jan 28, 2010 1:12 pm

abdo19 wrote:I made Permission in Manifest file

The problem is:

can I use startActivity(new Intent(this, Display_Map.class)) in which Display_Map is a MapActivity

can you help me


try this

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. startActivity(new Intent(getBaseContext(),Display_Map.class))
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
naveenballa
Junior Developer
Junior Developer
 
Posts: 13
Joined: Mon Nov 16, 2009 12:53 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 6 guests