The main activity is the one which starts before the other ones.
Questions tagged [main-activity]
201 questions
3
votes
1 answer
How to start an AsyncTask on ActivityResult and show on MainActivity
I open an intent for capture an image and OnActivityResult i call an AsyncTask to start to make some processing to the image. The problem is that i want to load first the mainActivity and then start the AsyncTask in order to see the percentage of…

George Melidis
- 599
- 3
- 9
- 25
2
votes
3 answers
In an Android application,can more than one Main Activity exist
I hope someone will help. In Android manifest file, can we specify more than one activity as the main activity?

Android-iPhone-rahul
- 457
- 1
- 6
- 14
2
votes
3 answers
Android - call MainActivity method from Fragment on the second attempt crashes app
Here is what I use to trigger method on MainActvity.java from my Fragment page:
((MainActivity) getActivity()).openGallery();
Once I get to slide in the fragment page for the first time after opening app, and execute this code, IT WORKS.…

ekashking
- 387
- 6
- 19
2
votes
3 answers
Android Development: Directing to specific tabs in fragment
This is how the Main Activity looks like. By clicking on each cardview in the main activity it takes me to Activity two which holds fragments with sliding tab layout and recyclerview. The issue i'm having is trying to direct each cardview to its own…

Jalal Atsakzai
- 33
- 4
2
votes
2 answers
Importing multiple images in Android application
How can I import multiple images on my Android app? Can I assign single id to that bundle of images to bring it from drawable? Suggest me a way.
Currently I am only able to display one image multiple times in line layout. Here is the code line to…

P Dave
- 23
- 2
2
votes
1 answer
How to update and delete data from table in MainActivity in SQLITEOPENHELPER
Question is how display data from user id.
I am Created a database for students with fields Name,surname,marks and I did insert and view Sucesfully but I don't know how to do Update and Delete please help. here i want to do update and delete based…

Karthick
- 584
- 4
- 25
2
votes
1 answer
Why is this Error showing "Incompatible Types." "Required: android.support.v4.app.Fragment"?
So my issue is with my Android app Fragments fragment=new SlideShow(); is in a switch, this fuctions the NavDrawer and these people had the same issue but none of these Solutions fixed my problem Solution 1 and Solution 2 also Solution 3
You may see…

RTarson
- 351
- 3
- 23
2
votes
5 answers
MainActivity class not generated in Eclipse?
Every since I updated Eclipse with the SDK manager to 23.0.1245622 when I go to make a new Andorid Application Project it won't generate the MainActivity in the SRC file. I have researched my issue and have tried uninstalling and reinstalling every,…

user2129373
- 21
- 1
2
votes
1 answer
Is it bad form to expose public properties and methods to fragments from a Main Activity?
Given:
From a fragment, you can always call getActivity() to get a reference to the activity in context.
And of course, you can you can cast this instance to a strong type (like MainActivity) to get references to public properties and public…

Jim G.
- 15,141
- 22
- 103
- 166
2
votes
1 answer
Why wont my app process my intent?
I have this app:
import android.R.drawable;
import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
public class…

sebastian nielsen
- 505
- 1
- 10
- 23
2
votes
3 answers
(help) java.lang.runtimeexception unable to start activity componentinfo
I am new to programming and Im sorry if this type of question has been asked tons of times already.
and i am so confused with those errors please help ...
Here is My MainActivity.java
package id.romi.androidquiz;
import…

Romi Naufal
- 31
- 2
- 8
2
votes
1 answer
Android - Passing args from AlertDialog to AlertDialog'host
In my MainActivity, I generate a DialogAlert with 2 EditTexts inside.
I want to recover my 2 EditTexts in my MainActivity when I click on the Positive Button in the DialogAlert.
Here my DialogAlert class:
public class ShareDialog extends…

ErWaN
- 77
- 1
- 6
2
votes
0 answers
getSelectedText on inactive InputConnection-working on retrieving Title Column from CalendarContract.Events in android
When I click on the button, then it should retrieve (for now) Title column from CalendarContract.Events and then set the Title retrieved in an Edit Text View.The code I am using is :
public void oc(View view1)
{
final String[]…

user1968656
- 21
- 2
1
vote
1 answer
Cleaning up Android Main Activity Code
I'm a real noob when it comes to Java and OOP in general. I'm having issues with my app crashing and I think it's because my Main Activity is cluttered and my overall program is not structured properly. Can anyone advise me on how to clean up the…

mkyong
- 12,497
- 12
- 37
- 56
1
vote
4 answers
How can I split MainActivity functionality into an another class for clarity?
I have an android program and I want to be able to split the functionality in MainActivity into multiple files to keep my code organized, but I'm getting a null object reference error.
To demonstrate the error, I created a simple program that has…

Jaitnium
- 621
- 1
- 13
- 27