Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7190

Android app stops unfortunately on running a specific activity

$
0
0

Hey guys I am building an application in which I have added spinner.No error is shown in my activity but when I run my app,it crashes with message "Unfortunately your app has stopped".I checked my logcat and I found following errors there.Redis baseband write connect error: Connection refusedE/network_profile_handler: Error. network interface data NULLE/dalvikvm: Could not find class 'android.graphics.drawable.AnimatedVectorDrawable', referenced from method androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat.startI don't know the exact reason why my app crashed.As far as my code is concerned,I don't think I made any mistake but if you want I can post my code and logcat so you guys can help me figure out the actual mistake.I'm a beginner to android studio having less experience.I am not sure whether something is wrong with my emulator or code.Can anyone help me with this issue?

package com.example.oneclickscanner;import androidx.appcompat.app.AppCompatActivity;import android.content.Intent;import android.graphics.Color;import android.os.Bundle;import android.view.View;import android.view.ViewGroup;import android.widget.Adapter;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.EditText;import android.widget.Spinner;import android.widget.TextView;import android.widget.Toast;import java.lang.reflect.Array;import java.util.ArrayList;import java.util.Arrays;import java.util.List;public abstract class ModelAndLicenseInfo extends AppCompatActivity implements AdapterView.OnItemSelectedListener {    Spinner carModelSpinner;    TextView aboutPageText;    Button nextButton, prevButton;    EditText edtLicensePlateNumber;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.activity_model_and_license_info);        // Spinner element        carModelSpinner = findViewById(R.id.carModelSpinner);        aboutPageText = findViewById(R.id.aboutPageText);        nextButton = findViewById(R.id.nextButton);        prevButton = findViewById(R.id.prevButton);        edtLicensePlateNumber = findViewById(R.id.edtLicensePlateNumber);  carModelSpinner.setOnItemSelectedListener(this);        List<String> carModels = new ArrayList<>();        carModels.add("Tesla S60");        carModels.add("Tesla S70");        carModels.add("Tesla S75");        carModels.add("Tesla S80");        //Creating adapter for spinner        ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item,carModels);        // Drop down layout style - list view with radio button        spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        //attaching spinnerArrayAdapter to spinner        carModelSpinner.setAdapter(spinnerAdapter);

Viewing all articles
Browse latest Browse all 7190

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>