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

Android Studio Java Discussion :

je tourne tourne en rond


Sujet :

Android Studio Java

  1. #1
    Futur Membre du Club
    Homme Profil pro
    Webmaster
    Inscrit en
    Mai 2017
    Messages
    21
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Corrèze (Limousin)

    Informations professionnelles :
    Activité : Webmaster
    Secteur : Services à domicile

    Informations forums :
    Inscription : Mai 2017
    Messages : 21
    Points : 7
    Points
    7
    Par défaut je tourne tourne en rond
    Bonjour, aux codeuses et codeurs

    voici mon code erreur

    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
    E/AndroidRuntime: FATAL EXCEPTION: main
        Process: insecte.programme.ulision, PID: 18752
        java.lang.RuntimeException: Unable to start activity ComponentInfo{insecte.programme.ulision/insecte.programme.ulision.ui.home.D_Holometabola.Lepidoptera_ORDER.PlaceDetailsActivity}: java.lang.NullPointerException
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3449)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
            at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
            at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
            at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
            at android.os.Handler.dispatchMessage(Handler.java:106)
            at android.os.Looper.loop(Looper.java:223)
            at android.app.ActivityThread.main(ActivityThread.java:7656)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
         Caused by: java.lang.NullPointerException
            at java.util.Objects.requireNonNull(Objects.java:220)
            at insecte.programme.ulision.ui.home.D_Holometabola.Lepidoptera_ORDER.PlaceDetailsActivity.init(PlaceDetailsActivity.java:63)
            at insecte.programme.ulision.ui.home.D_Holometabola.Lepidoptera_ORDER.PlaceDetailsActivity.onCreate(PlaceDetailsActivity.java:35)
            at android.app.Activity.performCreate(Activity.java:8000)
            at android.app.Activity.performCreate(Activity.java:7984)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601) 
            at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85) 
            at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
            at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066) 
            at android.os.Handler.dispatchMessage(Handler.java:106) 
            at android.os.Looper.loop(Looper.java:223) 
            at android.app.ActivityThread.main(ActivityThread.java:7656) 
            at java.lang.reflect.Method.invoke(Native Method) 
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 
    I/Process: Sending signal. PID: 18752 SIG: 9
    Disconnected from the target VM, address: 'localhost:64015', transport: 'socket'
    et voici le code mon fichier java

    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
    public class PlaceDetailsActivity extends AppCompatActivity {
     
        private ImageView placeImageView;
        private TextView placeNameTextView, placeDescriptionTextView, placeCityTextView, placePhoneTextView, placeAddressTextView, placeRatingCountTextView;
        private LinearLayout phoneLinearLayout;
        private RatingBar placeRatingBar;
        private String placeType;
        private PlaceModel placeModel;
     
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_place_details);
     
            init();
            setViewsValues();
     
        }
     
        @Override
        public void onBackPressed(){
            sendToMain();
        }
     
        @Override
        public boolean onOptionsItemSelected(@NonNull MenuItem item) {
            if (item.getItemId() == android.R.id.home) {
                sendToMain();
            }
            return super.onOptionsItemSelected(item);
        }
     
        private void sendToMain(){
            Intent intent = new Intent(this, Lepidopteres__Deux.class);
            intent.putExtra("type", placeType);
            startActivity(intent);
            finish();
        }
     
        private void init(){
            Gson gson = new Gson();
     
    //        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
            getSupportActionBar().setTitle(R.string.details_header);
     
            placeImageView = findViewById(R.id.place_imageView);
            placeNameTextView = findViewById(R.id.placeName_textView);
            placeDescriptionTextView = findViewById(R.id.placeDesc_textView);
            placeCityTextView = findViewById(R.id.placeCity_textView);
            placePhoneTextView = findViewById(R.id.placePhone_textView);
            placeAddressTextView = findViewById(R.id.placeAddress_textView);
            phoneLinearLayout = findViewById(R.id.phone_linearLayout);
            placeRatingBar = findViewById(R.id.place_RatingBar);
            placeRatingCountTextView = findViewById(R.id.ratingCount_textView);
     
            placeType = getIntent().getStringExtra("type");
            String placeAsString = getIntent().getStringExtra("placeObj");
     
     
            placeModel = gson.fromJson(placeAsString, PlaceModel.class);
        }
     
        private void setViewsValues(){
            if(placeType.equals("historical")) {
                phoneLinearLayout.setVisibility(View.GONE);
            } else {
                placePhoneTextView.setText(placeModel.getPhone());
            }
     
            placeImageView.setImageResource(placeModel.getImageResID());
            placeNameTextView.setText(placeModel.getName());
            placeDescriptionTextView.setText(placeModel.getDescription());
            placeCityTextView.setText(placeModel.getCity());
            placeAddressTextView.setText(placeModel.getAddress());
            placeRatingBar.setRating(placeModel.getRate());
            placeRatingCountTextView.setText(String.valueOf(placeModel.getRate()));
        }
    }
    si vous pouvais m'aider à résoudre mon problème détail par détail afin que je puisse comprendre les erreurs et surtout pouvoir rectifier , ce serai cool merci .

  2. #2
    Futur Membre du Club
    Homme Profil pro
    Webmaster
    Inscrit en
    Mai 2017
    Messages
    21
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Corrèze (Limousin)

    Informations professionnelles :
    Activité : Webmaster
    Secteur : Services à domicile

    Informations forums :
    Inscription : Mai 2017
    Messages : 21
    Points : 7
    Points
    7
    Par défaut
    j'ai supprimé les lignes

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    //        setViewsValues();
    //        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    //        getSupportActionBar().setTitle(R.string.details_header);
    l'activité s'ouvre mais vide , comment avoir les données.
    autre question à la place d'ouvrir une activité et il possible d'ouvrir un fragment à la place et comment dois je procéder . merci

  3. #3
    Futur Membre du Club
    Homme Profil pro
    Webmaster
    Inscrit en
    Mai 2017
    Messages
    21
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Corrèze (Limousin)

    Informations professionnelles :
    Activité : Webmaster
    Secteur : Services à domicile

    Informations forums :
    Inscription : Mai 2017
    Messages : 21
    Points : 7
    Points
    7
    Par défaut
    y a personne sur ce forum ou personne ne veut m'écrire me dire la solution

  4. #4
    Futur Membre du Club
    Homme Profil pro
    Webmaster
    Inscrit en
    Mai 2017
    Messages
    21
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Corrèze (Limousin)

    Informations professionnelles :
    Activité : Webmaster
    Secteur : Services à domicile

    Informations forums :
    Inscription : Mai 2017
    Messages : 21
    Points : 7
    Points
    7
    Par défaut
    LES FORUMS D AIDE C EST PLUS CE QUE C ETAIT

  5. #5
    Membre chevronné Avatar de jeffray03
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2008
    Messages
    1 501
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 501
    Points : 2 120
    Points
    2 120
    Par défaut
    Salut,
    peux-tu me montrer la ligne 63 dans PlaceDetailsActivity.java

    Eric

  6. #6
    Futur Membre du Club
    Homme Profil pro
    Webmaster
    Inscrit en
    Mai 2017
    Messages
    21
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Corrèze (Limousin)

    Informations professionnelles :
    Activité : Webmaster
    Secteur : Services à domicile

    Informations forums :
    Inscription : Mai 2017
    Messages : 21
    Points : 7
    Points
    7
    Par défaut
    merci de bien vouloir regarder mon adaptation de code java .
    donc en tout ça ce joue sur 4 fichier si j'ai bien suivie le tuto lui liste de vue d'un drawer. oui, je sais . c'est en gros le seul , que je peux en gros comprendre et encore. j'essais d'adapter ce tuto de liste de vue . 1 qui s'ouvre en fragment dans mon conteneur et pas dans une nouvelle activité . j'ai renommais les noms des fichiers pas forcement même noms que ceux précédant.

    fichier 1
    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
     
     
     
    public class Insectes_Show extends AppCompatActivity {
        // keys use to send data between fragments
        public static  String NAME_PLACE_KEY = "name";
        public static  String ADDEESS_PLACE_KEY = "address";
        public static  String ABOUT_PLACE_KEY = "about";
        public static  String lOCATION_PLACE_KEY = "location";
        public static  String PHOTO_PLACE_KEY = "photo";
        public static  String TITLE_ACTIVITY_KEY = "title";
     
        private String getNamePlace ;
     
        public
        Insectes_Show() { }
     
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.fragment_place_show);
     
            // fine elemet , receive and set data
            TextView namePlace = findViewById(R.id.palce_name);
     
            getNamePlace = getIntent().getStringExtra(NAME_PLACE_KEY);
     
            namePlace.setText(getNamePlace);
     
            String info = getIntent().getStringExtra(ABOUT_PLACE_KEY);
     
            TextView infoPlace = findViewById(R.id.info_place);
     
            infoPlace.setText(info);
     
            LinearLayout call_phone = findViewById(R.id.call_phone);
     
        }
    fichier 2

    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
     
     
    public class InsectesAdapter extends RecyclerView.Adapter<InsectesAdapter.viewholder> {
        //define context
        Context context;
        //Define the list to put the places data in
        ArrayList<InsectesInfo> placeArray;
        // object from interface Listener
        PlaceListener Insectes_Listener;
     
        public
        InsectesAdapter(Context context, ArrayList<InsectesInfo> placeArray , PlaceListener Insectes_Listener) {
            this.context = context;
            this.placeArray = placeArray;
            this.Insectes_Listener = Insectes_Listener;
        }
     
        public
        InsectesAdapter(FragmentActivity fragmentActivity, ArrayList<InsectesInfo> places) {
     
        }
     
        //viewholder from RecyclerView.Adapter
        @NonNull
        @Override
        public viewholder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
            //Define View to bind xml elements
            View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.insectes_item_de_liste,parent,false);
            return new viewholder(view);
        }
     
        @Override
        public void onBindViewHolder(@NonNull viewholder holder, int position) {
            // reference from position class insectesInfo
            InsectesInfo insectesInfo = placeArray.get(position);
            //call method blud xml
            holder.bludIn(insectesInfo);
        }
     
        // return Count list to RecyclerView.Adapter
        @Override
        public int getItemCount() {
            return placeArray.size();
        }
     
        // inner class viewholder
        public class viewholder extends RecyclerView.ViewHolder  {
     
            // define elements
            ImageView imageView;
            TextView Insectes_Name, placeAddress;
            LinearLayout placeView;
            //find elements from xml
            public viewholder(@NonNull View itemView) {
                super(itemView);
                imageView = itemView.findViewById(R.id.place_image);
                Insectes_Name = itemView.findViewById(R.id.name_place_text);
                placeAddress = itemView.findViewById(R.id.address_place_text);
                placeView = itemView.findViewById(R.id.place_item_view);
            }
     
            // method bluid view in RecyclerView
            public void bludIn(InsectesInfo insectesInfo){
                //set date in elemenet
                Insectes_Name.setText(insectesInfo.getNamePlace());
                placeAddress.setText(insectesInfo.getPlaceAddress());
                //call method decodeSampleBitmap
                Bitmap bitmap = decodeSampleBitmap(context.getResources(), insectesInfo.getPlaceImg(),50,35);
                //set img
                imageView.setImageBitmap(bitmap);
                // Listener view for element in RecyclerView
                placeView.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        Insectes_Listener.InsectesListener (insectesInfo);
                    }
                });
            }
        }
     
    // de ici
        public Bitmap decodeSampleBitmap(Resources res , int resId, int reqWidth , int reqHeight) {
            final BitmapFactory.Options options = new BitmapFactory.Options();
            options.inJustDecodeBounds = true;
            BitmapFactory.decodeResource(res,resId,options);
            options.inSampleSize = calcSampleSize(options ,reqWidth,reqHeight);
            options.inJustDecodeBounds =false;
            return BitmapFactory.decodeResource(res,resId,options);
        }
        public  int calcSampleSize(BitmapFactory.Options options ,int reqWihdth , int reqHight ){
            final int height = options.outHeight;
            final  int width = options.outWidth;
            int inSampleSize = 1;
            if (height>reqHight || width>reqHight){
                final int halfHeight = height/2;
                final  int halfWidth = width/2;
                while ((halfHeight/inSampleSize) > reqHight && (halfWidth/inSampleSize) > reqWihdth){
                    inSampleSize*=2;
                }
            } return inSampleSize;
        }
    // ici
     
        //interface to Listener view
        public interface PlaceListener{
            void InsectesListener(InsectesInfo insectesInfo);
        }
    }
    fichier 3

    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
     
    public class InsectesInfo {
     
        // date to need in view
        private String namePlace;
        private String placeAddress;
        private String aboutPlace;
        private String phonePlace = "0";
        private String locationPlace;
        private int placeImg ;
     
        public
        InsectesInfo(String namePlace, String placeAddress , String aboutPlace
                , String phonePlace , String locationPlace, int placeImg) {
     
            this.namePlace = namePlace;
            this.placeAddress = placeAddress;
            this.placeImg = placeImg;
            this.aboutPlace = aboutPlace;
            this.phonePlace = phonePlace;
            this.locationPlace = locationPlace;
        }
     
        public
        InsectesInfo(String namePlace, String placeAddress , String aboutPlace
                 , String locationPlace, int placeImg) {
            this.namePlace = namePlace;
            this.placeAddress = placeAddress;
            this.placeImg = placeImg;
            this.aboutPlace = aboutPlace;
            this.locationPlace = locationPlace;
        }
     
        public  boolean hasPhone (){
            return !(phonePlace.equals("0"));
        }
        public String getAboutPlace() {
            return aboutPlace;
        }
     
        public void setAboutPlace(String aboutPlace) {
            this.aboutPlace = aboutPlace;
        }
     
        public String getPhonePlace() {
            return phonePlace;
        }
     
        public void setPhonePlace(String phonePlace) {
            this.phonePlace = phonePlace;
        }
     
        public String getLactionPlace() {
            return locationPlace;
        }
     
        public void setLactionPlace(String lactionPlace) {
            this.locationPlace = lactionPlace;
        }
     
        public String getNamePlace() {
            return namePlace;
        }
     
        public void setNamePlace(String namePlace) {
            this.namePlace = namePlace;
        }
     
        public String getPlaceAddress() {
            return placeAddress;
        }
     
        public void setPlaceAddress(String placeAddress) {
            this.placeAddress = placeAddress;
        }
     
        public int getPlaceImg() {
            return placeImg;
        }
     
        public void setPlaceImg(int placeImg) {
            this.placeImg = placeImg;
        }
    }
    fichier 4

    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
     
     
    public class Lepidopteres__Un extends Fragment implements InsectesAdapter.PlaceListener {
     
     
        public Lepidopteres__Un() {
            // Required empty public constructor
        }
     
        //Define the list to put the places data in
        ArrayList<InsectesInfo> places = new ArrayList<>();
        //define RecyclerView
        RecyclerView recyclerView;
        private Intent intent;
     
        public View onCreateView(@NonNull LayoutInflater inflater,
                ViewGroup container, Bundle savedInstanceState) {
            //Define View to bind xml elements
            View root = inflater.inflate(R.layout.fragment_lepidopteres__un, container, false);
            //find element recyclerView
            recyclerView = root.findViewById(R.id.recycler_view);
            // set Data places
            places.add(new InsectesInfo ("fraise 1","fraise 2 ","fraise 3","fraise 4","frais 5", R.drawable.fourmis1));
            places.add(new InsectesInfo ("poire  1","poire  2 ","poire  3","poire  4","poire  5", R.drawable.fourmis2));
            places.add(new InsectesInfo ("pomme  1","pomme  2 ","pomme  3","pomme  4","pomme  5", R.drawable.fourmis3));
            places.add(new InsectesInfo ("orange 1","orange 2 ","orange 3","orange 4","orange 5", R.drawable.fourmis4));
            places.add(new InsectesInfo ("cerize 1","cerize 2 ","cerize 3","cerize 4","cerize 5", R.drawable.fourmis5));
            places.add(new InsectesInfo ("fraise 1","fraise 2 ","fraise 3","fraise 4","frais 5", R.drawable.fourmis6));
            places.add(new InsectesInfo ("fraise 1","fraise 2 ","fraise 3","fraise 4","frais 5", R.drawable.fourmis7));
            places.add(new InsectesInfo ("fraise 1","fraise 2 ","fraise 3","fraise 4","frais 5", R.drawable.fourmis8));
            places.add(new InsectesInfo ("fraise 1","fraise 2 ","fraise 3","fraise 4","frais 5", R.drawable.fourmis9));
     
     
            //defind object from InsectesAdapter to pass to recyclerView
            InsectesAdapter adapter = new InsectesAdapter (getContext(),places,this);
            //put LinearLayoutManager to recyclerView
            recyclerView.setLayoutManager(new LinearLayoutManager (getContext() , RecyclerView.VERTICAL , false));
            //set adapter
            recyclerView.setAdapter(adapter);
            return root;
        }
        //method listener to recyclerView substitute of tOnItemClickListener
        @Override
        public void InsectesListener(InsectesInfo insectesInfo) {
            //created intent to pass data
            Intent intent = new Intent (getContext ( ), Insectes_Show.class);
            // Sent data
            intent.putExtra (Insectes_Show.TITLE_ACTIVITY_KEY, 1);
            intent.putExtra (Insectes_Show.ABOUT_PLACE_KEY, insectesInfo.getAboutPlace ( ));
            intent.putExtra (Insectes_Show.NAME_PLACE_KEY, insectesInfo.getNamePlace ( ));
            intent.putExtra (Insectes_Show.ADDEESS_PLACE_KEY, insectesInfo.getPlaceAddress ( ));
            intent.putExtra (Insectes_Show.lOCATION_PLACE_KEY, insectesInfo.getLactionPlace ( ));
            intent.putExtra (Insectes_Show.PHOTO_PLACE_KEY, insectesInfo.getPlaceImg ( ));
     
     
            startActivity(intent);
        }
    }
    et voila mon code erreur complet merci

    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
     
    E/AndroidRuntime: FATAL EXCEPTION: main
        Process: insecte.programme.ulision, PID: 3651
        android.content.ActivityNotFoundException: Unable to find explicit activity class {insecte.programme.ulision/insecte.programme.ulision.ui.home.D_Holometabola.Adapter.Insectes_Show}; have you declared this activity in your AndroidManifest.xml?
            at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2065)
            at android.app.Instrumentation.execStartActivity(Instrumentation.java:1727)
            at android.app.Activity.startActivityForResult(Activity.java:5314)
            at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:597)
            at android.app.Activity.startActivityForResult(Activity.java:5272)
            at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:583)
            at android.app.Activity.startActivity(Activity.java:5658)
            at androidx.core.content.ContextCompat$Api16Impl.startActivity(ContextCompat.java:830)
            at androidx.core.content.ContextCompat.startActivity(ContextCompat.java:279)
            at androidx.fragment.app.FragmentHostCallback.onStartActivityFromFragment(FragmentHostCallback.java:167)
            at androidx.fragment.app.Fragment.startActivity(Fragment.java:1391)
            at androidx.fragment.app.Fragment.startActivity(Fragment.java:1379)
            at insecte.programme.ulision.ui.home.D_Holometabola.Lepidoptera_ORDER.Lepidopteres__Un.InsectesListener(Lepidopteres__Un.java:75)
            at insecte.programme.ulision.ui.home.D_Holometabola.Adapter.InsectesAdapter$viewholder$1.onClick(InsectesAdapter.java:94)
            at android.view.View.performClick(View.java:7448)
            at android.view.View.performClickInternal(View.java:7425)
            at android.view.View.access$3600(View.java:810)
            at android.view.View$PerformClick.run(View.java:28305)
            at android.os.Handler.handleCallback(Handler.java:938)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:223)
            at android.app.ActivityThread.main(ActivityThread.java:7656)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
    voila j'espère que vous allez vraiment m'aider de tout cœur , ça fais environ 2 ans sans mentir. que je cherche et essais de comprendre les codes, tutos et sources libre, lecture de ci et de ça pas forcement utile pour mon projet donc perte de temps et le temps passe et passe. cela en autodidacte complet donc vraiment pas facile. merci merci

  7. #7
    Futur Membre du Club
    Homme Profil pro
    Webmaster
    Inscrit en
    Mai 2017
    Messages
    21
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Corrèze (Limousin)

    Informations professionnelles :
    Activité : Webmaster
    Secteur : Services à domicile

    Informations forums :
    Inscription : Mai 2017
    Messages : 21
    Points : 7
    Points
    7
    Par défaut
    un peu d'aide svp , merci

  8. #8
    Membre confirmé

    Homme Profil pro
    Développeur informatique
    Inscrit en
    Novembre 2013
    Messages
    343
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Administration - Collectivité locale

    Informations forums :
    Inscription : Novembre 2013
    Messages : 343
    Points : 536
    Points
    536
    Billets dans le blog
    2
    Par défaut Le dev pour Android est un véritable calvaire avec Android Studio
    Citation Envoyé par ulision Voir le message
    un peu d'aide svp , merci
    Bjr,

    Le dev pour Android est un véritable calvaire avec Android Studio.

    Je suis moi-même confronté à ce problème et les outils de dev ne fonctionnent pas, tout simplement.

    Considérez que la plateforme Android n'est pas programmable.


    J'ai jeté l'éponge en ce qui me concerne.

    Et vu la très faible activité de ce forum, je pense que AS a fait fuir beaucoup de développeurs (il a une note de 1/5, est bogué à mort, difficile à paramétrer et consomme énormément de place disque et RAM)

  9. #9
    Nouveau Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Octobre 2022
    Messages
    1
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 22
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Octobre 2022
    Messages : 1
    Points : 1
    Points
    1
    Par défaut
    Salut, J'essaye également de développer un application tout en apprenant, mais c'est pas toujours facile. Je m'aide énormément de chatGPT pour corriger mes erreurs sur ce genre de chose...
    voici ce qu'il répond à ton problème ? Je sais pas si ça peut t'aider, mais c'est mieux que rien ?


    L'erreur est la suivante : android.content.ActivityNotFoundException: Unable to find explicit activity class {insecte.programme.ulision/insecte.programme.ulision.ui.home.D_Holometabola.Adapter.Insectes_Show}; have you declared this activity in your AndroidManifest.xml?. Cela signifie que l'activité Insectes_Show n'est pas déclarée dans le fichier AndroidManifest.xml et n'est donc pas trouvée lorsqu'elle est appelée.

    Pour résoudre cette erreur, vous devez vous assurer que l'activité Insectes_Show est bien déclarée dans le fichier AndroidManifest.xml. Voici un exemple de déclaration pour l'activité Insectes_Show :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    <activity
        android:name=".ui.home.D_Holometabola.Adapter.Insectes_Show"
        android:label="@string/app_name" />
    Assurez-vous que le nom de l'activité est correct et que le chemin d'accès est le même que celui utilisé dans le code de l'application. Ensuite, exécutez à nouveau votre application.

Discussions similaires

  1. Réponses: 4
    Dernier message: 21/07/2006, 10h58
  2. Quetion de débutant ... bête mais je tourne en rond
    Par JohnQc dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 14/04/2006, 17h39
  3. Requete qui tourne en rond
    Par hugo69 dans le forum Requêtes et SQL.
    Réponses: 4
    Dernier message: 07/11/2005, 20h02
  4. Prog qui tourne en rond :-(
    Par FranckDev dans le forum CORBA
    Réponses: 2
    Dernier message: 07/09/2005, 13h50
  5. Je tourne en rond....
    Par Ol dans le forum Langage SQL
    Réponses: 3
    Dernier message: 16/02/2005, 07h54

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