IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Composants graphiques Android Discussion :

activation d'un bouton


Sujet :

Composants graphiques Android

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Inscrit en
    Mars 2011
    Messages
    140
    Détails du profil
    Informations forums :
    Inscription : Mars 2011
    Messages : 140
    Par défaut activation d'un bouton
    Bonjour à tous

    je veux activer mon bouton "ok" d'une alertDialog qui me permet d'ouvrir une nouvelle activite.mais une erreur "force close".

    voila les 2 activite ainsi que le main et le manifest:

    ************principale**********
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
     
    import java.util.ArrayList;
    import java.util.HashMap;
     
    import android.app.Activity;
    import android.app.AlertDialog;
    import android.content.DialogInterface;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.AdapterView;
    import android.widget.AdapterView.OnItemClickListener;
    import android.widget.ListView;
    import android.widget.SimpleAdapter;
    import android.widget.Toast;
     
    public class GuideActivity extends Activity {
     
     
    	private ListView maListViewPerso;
     
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
     
          //Récupération de la listview créée dans le fichier main.xml
            maListViewPerso = (ListView) findViewById(R.id.listviewperso);
            //Création de la ArrayList qui nous permettra de remplire la listView
            ArrayList<HashMap<String, String>> listItem = new ArrayList<HashMap<String, String>>();
     
          //On déclare la HashMap qui contiendra les informations pour un item
            HashMap<String, String> map;
     
          //Création d'une HashMap pour insérer les informations du premier item de notre listView
            map = new HashMap<String, String>();
            //on insère un élément titre que l'on récupérera dans le textView titre créé dans le fichier affichageitem.xml
            map.put("titre", "Frensh");
            //on insère un élément description que l'on récupérera dans le textView description créé dans le fichier affichageitem.xml
            map.put("description", "");
            //on insère la référence à l'image (convertit en String car normalement c'est un int) que l'on récupérera dans l'imageView créé dans le fichier affichageitem.xml
            map.put("img", String.valueOf(R.drawable.fr));
            //enfin on ajoute cette hashMap dans la arrayList
            listItem.add(map);
     
     
            map = new HashMap<String, String>();
            map.put("titre", "English");
            map.put("description", "");
            map.put("img", String.valueOf(R.drawable.eng));
            listItem.add(map);
     
     
            //Création d'un SimpleAdapter qui se chargera de mettre les items présent dans notre list (listItem) dans la vue affichageitem
            SimpleAdapter mSchedule = new SimpleAdapter (this.getBaseContext(), listItem, R.layout.affichageitem,
                   new String[] {"img", "titre", "description"}, new int[] {R.id.img, R.id.titre, R.id.description});
     
          //On attribut à notre listView l'adapter que l'on vient de créer
            maListViewPerso.setAdapter(mSchedule);
     
          //Enfin on met un écouteur d'évènement sur notre listView
            maListViewPerso.setOnItemClickListener(new OnItemClickListener() {
    			@SuppressWarnings("unchecked")
             	public void onItemClick1(AdapterView<?> a, View v, int position, long id) {
    				//on récupère la HashMap contenant les infos de notre item (titre, description, img)
            		HashMap<String, String> map = (HashMap<String, String>) maListViewPerso.getItemAtPosition(position);
            		//on créer une boite de dialogue
            		AlertDialog.Builder adb = new AlertDialog.Builder(GuideActivity.this);
            		//on attribut un titre à notre boite de dialogue
            		adb.setTitle("Sélection Item");
            		//on insère un message à notre boite de dialogue, et ici on affiche le titre de l'item cliqué
            		adb.setMessage("Votre choix : "+map.get("titre"));
            		//on indique que l'on veut le bouton ok à notre boite de dialogue
            		adb.setPositiveButton("Ok",null);/* new DialogInterface.OnClickListener() {
     
            			@Override
            			public void onClick(DialogInterface dialog, int which) {
            				// TODO Auto-generated method stub
            				
            				
            				
            				
            				
            				Intent intent = new Intent(GuideActivity.this,HelloGoogleMapActivity.class);
            				startActivity(intent);
            				
            				
            				
            			}  		    	 
            			    	//public void onCancel(DialogInterface dialog) {} 
     
            					
            			  
            			    });*/
     
            		//on affiche la boite de dialogue
            		adb.show();
            	}
     
    			@Override
    			public void onItemClick(AdapterView<?> a, View v, int position,
    					long id) {
    				// TODO Auto-generated method stub
     
    				//on récupère la HashMap contenant les infos de notre item (titre, description, img)
            		HashMap<String, String> map = (HashMap<String, String>) maListViewPerso.getItemAtPosition(position);
            		//on créé une boite de dialogue
            		AlertDialog.Builder adb = new AlertDialog.Builder(GuideActivity.this);
            		//on attribue un titre à notre boite de dialogue
            		adb.setTitle("Sélection Item");
            		//on insère un message à notre boite de dialogue, et ici on affiche le titre de l'item cliqué
            		adb.setMessage("Votre choix : "+map.get("titre"));
            		//on indique que l'on veut le bouton ok à notre boite de dialogue
            		adb.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
     
            			@Override
            			public void onClick(DialogInterface adb, int which) {
            				// TODO Auto-generated method stub
     
     
     
     
     
            				Intent intent = new Intent(GuideActivity.this,HelloGoogleMapActivity.class);
            				startActivity(intent);
     
     
     
            			}  		    	 
            			    	//public void onCancel(DialogInterface dialog) {} 
     
     
     
            			    });
            		//on affiche la boite de dialogue
            		adb.show();
     
    			}
             });
        }
    }
    ********************main*****************
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    <?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="@string/hello"
        />
     
        <ListView
            android:id="@+id/listviewperso"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
          />
     
    </LinearLayout>
    **************************helloGoogle****************

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    import java.io.IOException;
    import java.util.List;
    import java.util.Locale;
     
    import com.android.map.HelloItemizedOverlay;
    import com.android.map.R;
     
    import com.google.android.maps.GeoPoint;
    import com.google.android.maps.MapActivity;
    import com.google.android.maps.MapController;
    import com.google.android.maps.MapView;
    import com.google.android.maps.Overlay;
    import com.google.android.maps.OverlayItem;
     
    import android.app.Activity;
    import android.app.AlertDialog;
    import android.content.Context;
    import android.content.DialogInterface;
    import android.graphics.Bitmap;
    import android.graphics.BitmapFactory;
    import android.graphics.Canvas;
    import android.graphics.Point;
    import android.graphics.drawable.Drawable;
    import android.location.Address;
    import android.location.Geocoder;
    import android.location.Location;
    import android.location.LocationListener;
    import android.location.LocationManager;
    import android.net.ConnectivityManager;
    import android.net.NetworkInfo;
    import android.os.Bundle;
    import android.util.Log;
    import android.view.KeyEvent;
    import android.view.Menu;
    import android.view.MotionEvent;
    import android.widget.LinearLayout;
    import android.widget.TextView;
    import android.widget.Toast;
     
    public class HelloGoogleMapActivity extends MapActivity implements LocationListener{
     
     
    	private MapView    mapView;
    	private MapController mc;
    	private LocationManager lm;	
    	private MotionEvent event;	
    	private double      lat = 0;
    	private double      lng = 0;
    	 LinearLayout linearLayout;
     
     
     
    	TextView tv;
    	HelloItemizedOverlay itemizedoverlay;
     
        /** Called when the activity is first created. */
    	  @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main1);
     
            MapView mapView = (MapView) findViewById(R.id.mapView);
            mapView.setBuiltInZoomControls(true);
     
            //
           // lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
           // lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1l,1l, this);
     
            mc = mapView.getController();     
            mc.setZoom(17);
     
     
     
     
     
            List<Overlay> mapOverlays = mapView.getOverlays();
            Drawable drawable = this.getResources().getDrawable(R.drawable.pink);
            HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable,this);
     
     
     
     
     
            GeoPoint point = new GeoPoint((int)(36.854128 * 1E6),(int)(10.334809* 1E6));        
            OverlayItem overlayitem = new OverlayItem(point, "Anthonin de Carthage", "Les thermes d’Antonin, situés à Carthage (Tunisie), sont le plus vaste ensemble thermal romain construit sur le sol africain. Ils constituent aussi le seul bâtiment thermal de Carthage dont il subsiste quelques vestiges, en dépit de la prédation féroce qui a sévi sur le site archéologique et dépouillé le monument de ses matériaux.");  
           // mc.setCenter(point); 
            mc.setCenter(point); 
     
            GeoPoint point1 = new GeoPoint((int)(36.853372* 1E6),(int)(10.32423* 1E6));
            OverlayItem overlayitem1 = new OverlayItem(point1, "Musée National de Carthage", "hello");
           // mc.setCenter(point1);
     
            GeoPoint point2 = new GeoPoint((int)(36.85248* 1E6),(int)(10.323694* 1E6));
            OverlayItem overlayitem2 = new OverlayItem(point2, "Byrsa","hello");
            //mc.setCenter(point2);
     
            GeoPoint point3 = new GeoPoint((int)(36.857768* 1E6),(int)(10.329444* 1E6));
            OverlayItem overlayitem3 = new OverlayItem(point3, "Amphithéatre de Carthage", "hello");
            //mc.setCenter(point3);
     
            GeoPoint point4 = new GeoPoint((int)(36.858128* 1E6),(int)(10.331526* 1E6));
            OverlayItem overlayitem4 = new OverlayItem(point4, "Villas Romaines	", "hello");
            //mc.setCenter(point4);
     
            GeoPoint point5 = new GeoPoint((int)(36.854025* 1E6),(int)(10.323071* 1E6));
            OverlayItem overlayitem5 = new OverlayItem(point5, "Acropolium", "hello");
            //mc.setCenter(point5);
     
            GeoPoint point6 = new GeoPoint((int)(36.856171* 1E6),(int)(10.314832* 1E6));
            OverlayItem overlayitem6 = new OverlayItem(point6, "Amphithéatre1 de Carthage", "hello");
            //mc.setCenter(point6);
     
            GeoPoint point7 = new GeoPoint((int)(36.857545* 1E6),(int)(10.318415* 1E6));
            OverlayItem overlayitem7 = new OverlayItem(point7, "Phenix Carthage", "hello");
           // mc.setCenter(point7);
     
          //  GeoPoint point8 = new GeoPoint((int)(36.843087* 1E6),(int)(10.325539* 1E6));
          //  OverlayItem overlayitem8 = new OverlayItem(point8, "Site archéologique de Carthage"," Fondée dès le IXe siècle av. J.-C. sur le golfe de Tunis, Carthage établit à partir du VIe siècle un empire commercial s'étendant à une grande partie du monde méditerranéen et fut le siège d'une brillante civilisation. Au cours des longues guerres puniques, elle occupa des territoires de Rome, mais celle-ci la détruisit finalement en 146 av. J.-C. Une seconde Carthage, romaine celle-là, fut alors fondée sur ses ruines.");
     
     
     
            itemizedoverlay.addOverlay(overlayitem);
            itemizedoverlay.addOverlay(overlayitem1);
            itemizedoverlay.addOverlay(overlayitem2);
            itemizedoverlay.addOverlay(overlayitem3);
            itemizedoverlay.addOverlay(overlayitem4);
            itemizedoverlay.addOverlay(overlayitem5);
            itemizedoverlay.addOverlay(overlayitem6);
            itemizedoverlay.addOverlay(overlayitem7);
          //  itemizedoverlay.addOverlay(overlayitem8);
            mapOverlays.add(itemizedoverlay);
     
            mapView.isSatellite();
     
     
     
            lm = (LocationManager) this.getSystemService(LOCATION_SERVICE);
            lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 10000, 0, this);
            lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 10000, 0, this);
     
     
            mapView.setClickable(true);
     
     
     
        }
     
     
    	public boolean onTouchEvent(MotionEvent event, MapView mapView) 
        {   
            //---when user lifts his finger---
     
     
            if (event.getActionIndex()== 1) { 
     
     
                GeoPoint point = mapView.getProjection().fromPixels((int) event.getX(),(int) event.getY());
                    Toast.makeText(getBaseContext(), point.getLatitudeE6() / 1E6 + "," + 
                            point.getLongitudeE6() /1E6  ,Toast.LENGTH_SHORT).show();
     
            }                            
            return false;
        }
     
     
     
     
     
     
     
    	@Override
    	protected boolean isRouteDisplayed() {
    		// TODO Auto-generated method stub
    		return false;
    	}
     
    	@Override
    	public boolean onKeyDown(int keyCode, KeyEvent event)
    	{
    	  if (keyCode == KeyEvent.KEYCODE_S)
    	  {
    	    mapView.setSatellite(!mapView.isSatellite());
    	    return true;
    	  }
    	  return super.onKeyDown(keyCode, event);
    	}
     
    	@Override
    	public void onLocationChanged(Location location) {
    		// TODO Auto-generated method stub
     
    		lat = location.getLatitude();
    		 lng = location.getLongitude();
    		 //"Location change to : Latitude = " + lat + " Longitude = " + lng
    		// Toast.makeText(getBaseContext(),"Je suis là",Toast.LENGTH_SHORT).show();
     
     
     
    		// lat = location.getLatitude();
    		 //lng = location.getLongitude();
    		 //"Location change to : Latitude = " + lat + " Longitude = " + lng
    		 Toast.makeText(getBaseContext(),"Je suis là",Toast.LENGTH_SHORT).show();
     
    		 GeoPoint p = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6));
     
    		/* OverlayItem overlayitem9 = new OverlayItem(p, "je suis là", null);
    		 Drawable dra = this.getResources().getDrawable(R.drawable.man);
    	        HelloItemizedOverlay itemizedoverlay1 = new HelloItemizedOverlay(dra,this);
    	        List<Overlay> mapOverlays = mapView.getOverlays();
    		itemizedoverlay1.addOverlay(overlayitem9);
    		 mapOverlays.add(itemizedoverlay1);
    	       // mc.setCenter(p);      
    		 mc.animateTo(p);
    		// mc.setCenter(p);*/
     
     
     
     
    	}
     
    	@Override
    	public void onProviderDisabled(String provider) {
    		// TODO Auto-generated method stub
     
    		//
    		// Log.e("GPS", "provider disabled " + provider);
             //tv = new TextView(this);
             //tv.setText(tv.getText()+"\nprovider disabled " + arg0);
             //setContentView(tv);
     
    	}
     
    	@Override
    	public void onProviderEnabled(String provider) {
    		// TODO Auto-generated method stub
     
    		// Log.e("GPS", "provider enabled " + provider);
             //tv = new TextView(this);
             tv.setText(tv.getText()+"\nprovider enabled " + provider);
             //setContentView(tv);
     
     
     
    	}
     
    	@Override
    	public void onStatusChanged(String provider, int status, Bundle extras) {
    		// TODO Auto-generated method stub
     
    	}
    }
    ************************main1********************

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    <?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="@string/hello"
        />
    <com.google.android.maps.MapView
     android:id="@+id/mapView"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:enabled="true"
     android:clickable="true"
     android:apiKey="@string/mapKey"
     />
     
     <LinearLayout android:id="@+id/zoom"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    />
     
    </LinearLayout>
    ****************manifest************************

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.android.map"
     android:versionCode="1"
     android:versionName="1.0">
       <application android:icon="@drawable/icon" android:label="@string/app_name">
           <uses-library android:name="com.google.android.maps" />
           <activity android:name=".HelloGoogleMapActivity"
                         android:label="@string/app_name">
               <intent-filter>
                  <action android:name="android.intent.action.MAIN" />
                  <category android:name="android.intent.category.LAUNCHER" />
              </intent-filter>
          </activity>
     
           <activity android:name=".GoogleSearch"
                         android:label="@string/app_name">
               <intent-filter>
                  <action android:name="android.intent.action.MAIN" />
                  <category android:name="android.intent.category.LAUNCHER" />
              </intent-filter>
          </activity>
            <activity android:name=".HelloGallery"
                         android:label="@string/app_name">
               <intent-filter>
                  <action android:name="android.intent.action.MAIN" />
                  <category android:name="android.intent.category.LAUNCHER" />
              </intent-filter>
          </activity>
      </application>
      <uses-permission android:name="android.permission.INTERNET" />
      <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
        <uses-permission android:name="android.permission.ACCESS_GPS" />
        <uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" />
        <uses-permission android:name="android.permission.LOCATION" />
     
        <uses-sdk android:minSdkVersion="8" />
    </manifest>

    merci

  2. #2
    Membre chevronné
    Profil pro
    Inscrit en
    Mars 2011
    Messages
    322
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2011
    Messages : 322
    Par défaut
    Bonjour,
    Est ce que tu peux mettre les erreurs de ton logcat ?
    Le Force close apparaît quand tu cliques sur le bouton ?

  3. #3
    Membre confirmé
    Inscrit en
    Mars 2011
    Messages
    140
    Détails du profil
    Informations forums :
    Inscription : Mars 2011
    Messages : 140
    Par défaut
    oui,elle apparaît quand je Click sur le bouton .



    03-30 08:20:30.779: INFO/ARMAssembler(66): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x397ae0:0x397bec] in 10083207 ns
    03-30 08:20:30.939: INFO/ARMAssembler(66): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x397c70:0x397e38] in 1760817 ns
    03-30 08:20:32.370: WARN/dalvikvm(308): Unable to resolve superclass of Lcom/android/map/HelloGoogleMapActivity; (65)
    03-30 08:20:32.370: WARN/dalvikvm(308): Link of class 'Lcom/android/map/HelloGoogleMapActivity;' failed
    03-30 08:20:32.389: ERROR/dalvikvm(308): Could not find class 'com.android.map.HelloGoogleMapActivity', referenced from method com.android.map.GuideActivity$1$1.onClick
    03-30 08:20:32.389: WARN/dalvikvm(308): VFY: unable to resolve const-class 52 (Lcom/android/map/HelloGoogleMapActivity in Lcom/android/map/GuideActivity$1$1;
    03-30 08:20:32.389: DEBUG/dalvikvm(308): VFY: replacing opcode 0x1c at 0x0008
    03-30 08:20:32.409: DEBUG/dalvikvm(308): VFY: dead code 0x000a-0016 in Lcom/android/map/GuideActivity$1$1;.onClick (Landroid/content/DialogInterface;I)V
    03-30 08:20:32.869: INFO/ARMAssembler(66): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x399a08:0x399ac4] in 546548 ns
    03-30 08:20:33.859: INFO/ActivityManager(66): Process android.process.acore (pid 161) has died.
    03-30 08:20:34.608: DEBUG/AndroidRuntime(308): Shutting down VM
    03-30 08:20:34.608: WARN/dalvikvm(308): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
    03-30 08:20:34.659: ERROR/AndroidRuntime(308): FATAL EXCEPTION: main
    03-30 08:20:34.659: ERROR/AndroidRuntime(308): java.lang.NoClassDefFoundError: com.android.map.HelloGoogleMapActivity
    03-30 08:20:34.659: ERROR/AndroidRuntime(308): at com.android.map.GuideActivity$1$1.onClick(GuideActivity.java:126)
    03-30 08:20:34.659: ERROR/AndroidRuntime(308): at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:158)
    03-30 08:20:34.659: ERROR/AndroidRuntime(308): at android.os.Handler.dispatchMessage(Handler.java:99)
    03-30 08:20:34.659: ERROR/AndroidRuntime(308): at android.os.Looper.loop(Looper.java:123)
    03-30 08:20:34.659: ERROR/AndroidRuntime(308): at android.app.ActivityThread.main(ActivityThread.java:4627)
    03-30 08:20:34.659: ERROR/AndroidRuntime(308): at java.lang.reflect.Method.invokeNative(Native Method)
    03-30 08:20:34.659: ERROR/AndroidRuntime(308): at java.lang.reflect.Method.invoke(Method.java:521)
    03-30 08:20:34.659: ERROR/AndroidRuntime(308): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
    03-30 08:20:34.659: ERROR/AndroidRuntime(308): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
    03-30 08:20:34.659: ERROR/AndroidRuntime(308): at dalvik.system.NativeStart.main(Native Method)
    03-30 08:20:34.709: WARN/ActivityManager(66): Force finishing activity com.android.map/.GuideActivity
    03-30 08:20:35.328: WARN/ActivityManager(66): Activity pause timeout for HistoryRecord{45042850 com.android.map/.GuideActivity}
    03-30 08:20:40.948: INFO/Process(308): Sending signal. PID: 308 SIG: 9
    03-30 08:20:40.984: INFO/ActivityManager(66): Process com.android.map (pid 308) has died.
    03-30 08:20:40.988: INFO/WindowManager(66): WIN DEATH: Window{450f7090 com.android.map/com.android.map.GuideActivity paused=false}
    03-30 08:20:40.998: INFO/WindowManager(66): WIN DEATH: Window{450ab258 com.android.map/com.android.map.GuideActivity paused=false}
    03-30 08:20:41.118: WARN/InputManagerService(66): Got RemoteException sending setActive(false) notification to pid 308 uid 10040
    03-30 08:20:46.821: WARN/ActivityManager(66): Activity destroy timeout for HistoryRecord{45042850 com.android.map/.GuideActivity}

  4. #4
    Membre chevronné
    Profil pro
    Inscrit en
    Mars 2011
    Messages
    322
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2011
    Messages : 322
    Par défaut
    Je ne sais pas si on a le droit de mettre ça :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
     <application android:icon="@drawable/icon" android:label="@string/app_name">
           <uses-library android:name="com.google.android.maps" />
           <activity android:name=".HelloGoogleMapActivity"
                         android:label="@string/app_name">
               <intent-filter>
                  <action android:name="android.intent.action.MAIN" />
                  <category android:name="android.intent.category.LAUNCHER" />
              </intent-filter>
          </activity>
     
           <activity android:name=".GoogleSearch"
                         android:label="@string/app_name">
               <intent-filter>
                  <action android:name="android.intent.action.MAIN" />
                  <category android:name="android.intent.category.LAUNCHER" />
              </intent-filter>
          </activity>
            <activity android:name=".HelloGallery"
                         android:label="@string/app_name">
               <intent-filter>
                  <action android:name="android.intent.action.MAIN" />
                  <category android:name="android.intent.category.LAUNCHER" />
              </intent-filter>
          </activity>
      </application>
    Je crois qu'on ne peut pas mettre plusieurs android.intent.action.MAIN.

  5. #5
    Membre confirmé
    Inscrit en
    Mars 2011
    Messages
    140
    Détails du profil
    Informations forums :
    Inscription : Mars 2011
    Messages : 140
    Par défaut
    excusez moi,je me suis trompé pour le manifest.voilà le fichier voulu.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
     
     <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.android.map"
          android:versionCode="1"
          android:versionName="1.0">
     
     
        <application android:icon="@drawable/icon" android:label="@string/app_name">
            <activity android:name=".GuideActivity"
                      android:label="@string/app_name">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name=".HelloGoogleMapActivity"
                         android:label="@string/app_name">
               <intent-filter>
                  <action android:name="android.intent.action.MAIN" />
                  <category android:name="android.intent.category.LAUNCHER" />
              </intent-filter>
          </activity>
     
          <activity android:name=".GoogleSearch"
                         android:label="@string/app_name">
               <intent-filter>
                  <action android:name="android.intent.action.MAIN" />
                  <category android:name="android.intent.category.LAUNCHER" />
              </intent-filter>
          </activity>
           <activity android:name=".HelloGallery"
                         android:label="@string/app_name">
               <intent-filter>
                  <action android:name="android.intent.action.MAIN" />
                  <category android:name="android.intent.category.LAUNCHER" />
              </intent-filter>
          </activity>
     
        </application>
     
         <uses-permission android:name="android.permission.INTERNET" />
      <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
        <uses-permission android:name="android.permission.ACCESS_GPS" />
        <uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" />
        <uses-permission android:name="android.permission.LOCATION" />
     
        <uses-sdk android:minSdkVersion="8" />
    </manifest>

    Edit MrDuchnok : MERCI DE PENSER AUX BALISES CODES !

  6. #6
    Membre chevronné
    Profil pro
    Inscrit en
    Mars 2011
    Messages
    322
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2011
    Messages : 322
    Par défaut
    Actuellement quand tu lances ton application, tu as quatre activités qui sont lancées. C'est voulu ?

Discussions similaires

  1. [Win32] activer/désactiver un bouton
    Par gdpasmini dans le forum MFC
    Réponses: 2
    Dernier message: 07/06/2006, 18h10
  2. Activation d'un bouton en fonction d'une checkbox
    Par zamoto dans le forum Général JavaScript
    Réponses: 2
    Dernier message: 24/05/2006, 14h19
  3. [Win32] activation d'un bouton
    Par dede92 dans le forum Windows
    Réponses: 2
    Dernier message: 15/04/2006, 11h23
  4. comment activer/desactiver un bouton de controle
    Par OyyoDams dans le forum MFC
    Réponses: 17
    Dernier message: 09/04/2006, 11h15
  5. Réponses: 5
    Dernier message: 19/08/2005, 17h32

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo