I am trying to do a copy of Space Invaders with Kotlin and Android Studio to learn more about this kind of development but I have this error happening : E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.spaceinvaders, PID: 3982 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.spaceinvaders/com.example.spaceinvaders.GameView}: java.lang.InstantiationException: java.lang.Class<com.example.spaceinvaders.GameView> has no zero argument constructor at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2914) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3119) ..
Category : android-activity
My app has a navigation drawer implemented, when I clicked on the buttons, they work and take me to a fragment. Here’s the code in the main activity that linked the button to the fragment: @Override public boolean onNavigationItemSelected(@NonNull MenuItem item) { int id = item.getItemId(); if (id == R.id.nav_storyboard) { getSupportActionBar().setTitle("Storyboard"); getSupportFragmentManager().beginTransaction().replace(R.id.container,new HomeFragment()).commit(); } ..
I have 3 activities in my app Introductyactivity use as splash screen then Main activity where i have menu and I open 3rd activity from there. Now i press back key the screen goes to splash screen rather than go on Main activity I also make parent activity but it does not work. Source: Android ..
My android studio mainactivity and the overview part (the left side) look different after reinstalling it. How can i fix it ? how it looks like: [1]: https://i.stack.imgur.com/YG3ij.png how i expect it to look: [2]: https://i.stack.imgur.com/n1Gpf.png Source: Android..
I am trying to create a wear app that will display the longitude and latitude when the heart rate reaches a certain value, however when i try to start the location activity the app crashes. please bear with me as i am new to android development, i am sure both activites work just fine, but ..
My code was working fine and was opening a new activity, then suddenly crashes and gives the below error code, haven’t been able to find an answer elsewhere sadly. I have not changed the manifest either so am really not sure what is going on here, suggestions welcome! Here is the MainActivity code: public class ..
I have an app that has a sign up page for a user to create an account. Instead of showing all the fields for the user to fill out in one activity, I want to first show the user the phone number edit text, then the email and password, and finally the username and real ..
I have four fragments in a bottom navigation view which is initialised in the MainActivity class: public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); BottomNavigationView navView = findViewById(R.id.nav_view); AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder( R.id.navigation_home, R.id.navigation_simulation, R.id.navigation_news, R.id.navigation_settings) .build(); NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment); NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration); NavigationUI.setupWithNavController(navView, navController); } ..
I have created a Recycler view that is supposed to be created when the activity is created. Currently, when I click a button on my MainActivity, an intent launches the ListActivity which has my recyclerview but it doesn’t load. I have used toast message to confirm that each method is getting called, and that I ..

I have an e commerce android app and it is working fine but I want that when the users click the place order button the users order should go to the firebase Realtime database and they are. Here is an example: But I want that the address and products should be under one id. and ..
Recent Comments