The main activity is the one which starts before the other ones.
Questions tagged [main-activity]
201 questions
-1
votes
3 answers
How to launch Fragment instead of the Activitiy itself?
How can i start a Fragment in the AboutAndHelpActivity instead of the Activity itself or how can i put the Fragment in startActivity()?
//if it is the first start of the app, open HelpFragment once.
Boolean isFirstRun =…

SGE59
- 37
- 5
-1
votes
2 answers
Error while Running Activity must be exorted or contain an intent-filter
I am getting this error while running the MainActivity or App.
Main AndroidManifest.xml file:

Nix
- 142
- 3
- 13
-1
votes
1 answer
How do you decide the user chosen language(or locale) in Android programming?
In main activity, I show users set of languages.

sofs1
- 3,834
- 11
- 51
- 89
-1
votes
1 answer
GpsLocation: Invalid method declaration; return type required
When trying to integrate googleMaps into my MainActivity following instructions here, the word GpsLocation(orange box 6 on linked page) goes red and says- Invalid method declaration; return type required.
I know this means it has to be inside of a…

Rushat Rai
- 743
- 2
- 15
- 31
-1
votes
5 answers
Json Parsing,No value error in android
I am newbie in android programmimng and i am trying to create an app for my food blog.I found this json paring tutorial on internet. when i put my yql query into the code,it gives me an error " no value for json".
when i tried to fix them,i found…

priyaj
- 1
-1
votes
1 answer
Not getting answer the percentage of love calculator value in textbox
Not getting answer the percentage of love calculator value in text box 3 .when the application running it is showing the error application stopped. The following is the code for that which is entered in mainactivity .
EditText t1;
EditText…

Vivek
- 27
- 1
- 1
- 9
-1
votes
1 answer
Android Application gets crashed
The app crash because of the following code lines.
I have two string-array in a XML file named as Telephones in a folder named values and two TextView in text.xml.
I can not figure out what's going wrong here.
public class MainActivity extends…

abood250
- 3
- 1
- 5
-1
votes
2 answers
Error "Unhandled exception: java.io.IOException" while using OkHttp in MainActivity
Error has appeared on //Response response = client.newCall(request).execute();
return response.body().string();// lines.
The whole code:
`
OkHttpClient client = new OkHttpClient();
@Override
protected void onCreate(Bundle savedInstanceState)…

Yusuf
- 145
- 6
- 12
-1
votes
4 answers
How to open a separate activity on button press?
I want a button to open an activity class that sets a layout xml file. Everything is in order but the button doesn't work without the @Override method. With the @Override method I get this error:
The method onCreate1(Bundle) of type MainActivity…

King
- 256
- 1
- 11
-1
votes
1 answer
I have been having trouble with setting up a Navigation drawer in the mainActivity.java
How do you set up the Navigation Drawer in the mainActivity.java using android. I've been having trouble with it because I'm still fairly new to programming and I am attempting to make and finish my first app. I am currently stuck on the…

Budiriri Vimbai
- 3
- 3
-1
votes
1 answer
Why does my App crush?
Can someone point me out the error in this code. I am learning to code and I was trying to run my first app from tutorial I saw, until I found this message "Unfortunately, The New Boston has stopped". This the message I get when every time I tried…

user3857621
- 1
- 1
-1
votes
1 answer
Unable to resolve superclass of LoginActivity extends FacebookActivity
11-29 11:23:06.101: E/AndroidRuntime(301): at
com.mypackage.myapp.MainActivity.onCreate(MainActivity.java:41)
I usually don't see this unless it's a problem with the Manifest or the activity wasn't correctly initialized. Only problem is, it is…

Limbones
- 3
- 5
-2
votes
1 answer
GDPR SDK Error [ Android studio ]
I want to install GDPR SDK in my Android Studio project, but I have an error message in MainActivity when I call requestConsentInfoUpdate() on an instance of ConsentInformation.
public class MainActivity extends AppCompatActivity {
…

Ahmed
- 1
-2
votes
1 answer
How to connect button to main activity in Android studio?
I think that my question is easy but I have no idea how to solve it.
I made a java class (test_class) and xml file for this class. In xml file I made a button and its work correctly in test_class, but I have to use it in MainActivity.
I made this…

Gleb Ger
- 21
- 1
- 4
-2
votes
1 answer
Android: Call and execute a Class on the MainActivity Class
I m a beginner to android development. I am trying to create an app that is able to scan QR code. At first I have done everything on the MainActivity and everything works fine but now I need to make a class called QRScanner and then to call on the…

raeX
- 3,197
- 2
- 14
- 21