Questions tagged [main-activity]

The main activity is the one which starts before the other ones.

201 questions
1
vote
0 answers

Error in findViewById on methhod start

In mainActivity I have method "toast1" public class MainActivity extends Activity { //some imports public TextView txtv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
1
vote
0 answers

libgdx crashes on android fine on desktop

my Libgdx project works fine on the desktop but crashes on android genymotion emulator. my main activity doesn't seem to instatiate: 04-17 19:20:11.537: W/dalvikvm(1075): Class init failed in newInstance call (Lcom/me/mygdxgame/MainActivity;) and…
1
vote
0 answers

Keep getting this fatal error in Android Studio

This is my first time using Android Studio, but I have used Eclipse and Xamarin for android before. But when I open the main_activity.xml, there's no "visual" and no option to select one. I also get the fatal error that says this: Here's the…
1
vote
1 answer

Android: Using ViewPager to fill RelativeLayout from MainActivity

Ok I'll first try it short. Does anyone know how I insert this class public class ResultBar extends FragmentActivity implements ActionBar.TabListener { AppSectionsPagerAdapter mAppSectionsPagerAdapter; ViewPager mViewPager; public void…
1
vote
3 answers

RuntimeException: Unable to start activity(MainActivity cannot be cast to android.view.View$OnClickListener)

I am working on a drawing app and following the online tutorial here: http://mobile.tutsplus.com/tutorials/android/android-sdk-create-a-drawing-app-essential-functionality/ There are no problem until the last part (as above). Then, I have tried to…
aliceL.
  • 11
  • 1
  • 2
1
vote
1 answer

Communication between Class and Main Activity Android

I am new in Android so I hope you can excuse my ignorance I made an activity to control some bluetooth devices with my telephone, now that everything is working I would like to generate a new class from this activity, a class to take care of all…
1
vote
4 answers

Precise calculations in Android development, Java?

I'm creating a calculator for Android, Well so far it looks pretty much done... The thing is the answers are not precise, Addition, subtraction, multiplication work fine as decimal is usually not required.. When it comes to division the answer is…
Rohan Bojja
  • 655
  • 1
  • 16
  • 35
1
vote
1 answer

MainActivity.java doesn't recognize activity_main.xml

I made a perfectly working calculator program for practice for android. I didn't like the relative layout I started with and decided to try out grid layout. Now my MainActivity.java doesn't see the activity_main.xml file. I've checked the R.java…
Craig Smith
  • 583
  • 3
  • 9
  • 26
1
vote
3 answers

Issues with creating new Android MainActivity

I'm new to Android programming and am attempting to create a new Main Activity for my app (taken from the Android tutorial website). My original Main Activity is called "MainActivity". The new activity I want to be my Main Activity is called…
Nick
  • 51
  • 1
  • 8
1
vote
2 answers

Android - Access MainActivity Instance

i have a public method in my MainActivity.java and want to call it from another Activity. Therefore i need the MainAcitivity Instance. How can i access it from another Acitivity. Thanks
user1104836
  • 205
  • 1
  • 6
  • 16
1
vote
1 answer

And + Eclipse: How to change main-activity to sub-activity

Noob alert! I started my current app as a simple test activity running the main routine. I now want to turn it into a proper app which requires a main menu as the main_activity to call the sub activity with appropriate parameters. I'm used to simple…
Tickled Pink
  • 969
  • 2
  • 14
  • 26
1
vote
1 answer

Hide MainActivity window in phonegap application

I am developing an android app using phonegap (cordova-2.1.0). My MainActivity.java code is as following - package com.app.myapp; import android.os.Bundle; import org.apache.cordova.*; public class MainActivity extends DroidGap { @Override …
Pawan
  • 517
  • 1
  • 9
  • 25
1
vote
1 answer

Too much time before Main Activity is running and screen is updated

My App needs too much time before Main Activity is running and screen is updated When I test my App in some old cell phones or on Android Emulator, before the main App is showed, the app show it another "screen". That screen is no well configurate…
Mark Comix
  • 1,878
  • 7
  • 28
  • 44
0
votes
1 answer

Main activity disappear? Android

In my app I have couple activities. How to setup that every time user long press home and bring from background my app it display always main activity? Cause right now if user hide the app and log press "home" button, my app coming back to the…
goodm
  • 7,275
  • 6
  • 31
  • 55
0
votes
1 answer

intent-filter build two apps instead of one in Android Studio

I have a react native Project that's integrated with onesignal notification, in Android app when I built my app using Android Studio it installs two apps one called onesignal and the other one my main app and app runs perfect I tried to remove the…
KHUSER
  • 61
  • 7