The main activity is the one which starts before the other ones.
Questions tagged [main-activity]
201 questions
46
votes
5 answers
How to set my Activity as main activity in android?
I want to create own activity as main activity rather than using default MainActivity.
How can I define that in android manifest?

Sathish
- 1,147
- 3
- 10
- 20
25
votes
4 answers
'TAG' has private access in 'android.support.v4.app.FragmentActivity'
Almost everything in my activity is working fine, except for wherever TAG is referenced. TAG gets a red line and says: 'TAG' has private access in 'android.support.v4.app.FragmentActivity'.
MainActivity (without imports)-
public class MainActivity…

Rushat Rai
- 743
- 2
- 15
- 31
10
votes
2 answers
Android: How to call getActivity() in OnItemClickListener()?
I am trying to call getActivity() in the OnItemClickListener:
class ViewTest{ //called in a fragment
setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView> parent, View view, int…

user2212461
- 3,105
- 8
- 49
- 87
9
votes
1 answer
Calling Custom ListView Adapter from Fragment Class Main Activity
I've written a few listView activities, as a proof of concept for myself that I could do it. Now, I'm having trouble loading a listView activity into a single tab for an app with multiple tabs, that allows both swiping and tab selection for…

KeorynDeTar
- 135
- 1
- 1
- 6
7
votes
5 answers
How to Avoid Launching the Android Application Twice ,Running from Eclipse to real device
I am Running the application from eclipse and it's being launched twice: first time launching the app, then again relaunching after few seconds
My app Splash Screen--->> Main activity(Both Opening twice).
i already tried adding …

Kumar
- 969
- 2
- 22
- 56
6
votes
2 answers
Preventing main activity from being launched if running already
I have an application that is launched via an intent-filter action. The problem is that every time the event/ action occurs, Android displays a dialog asking to launch the app even if it is already started.
I want the behavior to be as…

Brian
- 6,910
- 8
- 44
- 82
5
votes
0 answers
SurfaceView over actionBar because of setZOrderOnTop
I have a problem with my SurfaceView, i need it for display video, i put transparent background to don't see a black screen in background when video is on load, and don't see black lines when scrolling while video is playing.
My application display…

Keveun
- 153
- 1
- 7
4
votes
1 answer
Get ViewPager views from MainActivity
I'm working on an app which uses a ViewPager with two swiping views (first_page.xml and second_page.xml) and has one activity (activity_main.xml).
When in the main activity class I try to access TextView (which is located in the first_page.xml)…

Andrea
- 43
- 1
- 3
3
votes
2 answers
Xamarin.Android : CS0103 The name 'SetSupportActionBar' does not exist in the current context
CS0103 The name 'SetSupportActionBar' does not exist in the current context
Am clean and build many of time but this error is occur and i will change my manifest xml theme also but there is an error how to can solve this issue
my android target…

logeshpalani31
- 1,416
- 12
- 33
3
votes
2 answers
How to pass context from MainActivity to another class in Android?
I am experiencing an issue when trying to pass the context from the MainActivity class to another. Here is the ContextPasser Class.
public class ContextPasser extends Application{
public Context context;
public ContextPasser(){
context =…

Akash Veerappan
- 76
- 1
- 1
- 6
3
votes
3 answers
how to create a helper screen in android
I want to get an helper screen over main activity for user to guide how to use the app.
This is my main activity.
Output: This is how I want to show helper screen to user.
This is my main_activity.xml file consists this code.

Bunny Joel
- 171
- 3
- 15
3
votes
1 answer
register module mainactivity.java react native
I'm trying to follow these instructions: https://www.npmjs.com/package/react-native-text-input-layout. I'm confused at the register module in mainactivity.java part. My mainactivity.java doesn't look at all like the one from the instructions.
This…

dms
- 35
- 1
- 6
3
votes
0 answers
Cannot Resolve symbol R in Main Activity
I can't figure out what I am missing , other projects are working fine but this project does not recognize R:
and I also got this error:
Error:Execution failed for task
':CpcBarcodeOpticonSample:processDebugResources'.
>…

infinity911
- 201
- 1
- 9
3
votes
1 answer
Android How to Call Method From Another Class
Right now I'm working on app that will draw line on onClick. I'm drawing line in LineView.java class and performing onClick method in MainActivity.java. To solve this problem I have checked similar questions.
The first…

Oleksandr Firsov
- 1,428
- 1
- 21
- 48
3
votes
4 answers
Cannot find MainActivity.java in Android Studio
I am currently writing an Android App using Android Studio 1.2. However, i cannot find MainActivity.java file in it.
Hope someone can help me out.
Thanks in advance.
Regards,
Al

Al_Stackoverflow
- 31
- 1
- 1
- 3