Questions tagged [main-activity]

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

201 questions
0
votes
1 answer

OnViewCreated never used causing issues in android

I was having a problem before where my application would crash due to the fourth tab being a nested fragment, so I moved the methods to the main activity to be called on when that tab was selected but now it's giving me the error that the…
0
votes
3 answers

Android Studio MainActivity.java:: error: ';' expected

I am new to Android development, When Android Studio in "MainActivity" class is compiled I get the following error I have pasted the error log…
0
votes
1 answer

Changing Mainactivity in Android

In iOS it is very use (when using storyboard) to change root view controller. Root view controller; Controller that loads/appears to user when user first opens the app. Is there a way to do that in android. I have an activity (e.g.…
user462455
  • 12,838
  • 18
  • 65
  • 96
0
votes
3 answers

No Admob in main activity

I have two activities in my app and I don't wanna show Admob in main activity, I tried adding only in second activity but it doesn't show up. Even if I add in main activity, it shows only in main activity not in second activity. But my intention is…
Selva
  • 1,310
  • 2
  • 14
  • 31
0
votes
2 answers

How to call onCreateView of a separate Fragement Class in MainActivity Class?

Please Help me. I want to show Fragment class List into MainActivity. I try in main activity new (); but It show blank page, but when I put all data into mainActivity and run then it show list of data. Actually, I want to learn how to get this…
0
votes
2 answers

Execution fail after moving MainActivity.java in Subfolder

I am currently working on my Android project. Like the title reads I moved my MainActivity.java file into my Activitys package, I did this because a friend of mine suggested me this to reasons of overview. Now I am getting the following error Code…
school_guy
  • 300
  • 2
  • 14
0
votes
1 answer

Android App Name Doesnt Get Displayed on toolbar

in my news app which has a navigation drawer,doesnt display the activity/app name in the toolbar,all other activity refer the app name from the Strings.xml and display respectivly in their toolbar,but the main activity which starts from the launcher…
0
votes
1 answer

TextToSpeech(this, this); does not work

Thanks for seeing my question. My problem is that TextToSpeech(this, this); does not work. I have initiated it in my code like this. private TextToSpeech txt2Speech; then inside onCreate() txt2Speech = new TextToSpeech(this, this); And the end…
KISHORE_ZE
  • 1,466
  • 3
  • 16
  • 26
0
votes
1 answer

Android - Main menu (not option menu or settings menu), shoud it be in main activity?

I want to write a clean, modern app. I've created several of apps and now have a simple question. I want to create main menu to navigate app like on screen (not option menu / settings menu). Should I create it in MainActivity of app, or is there…
0
votes
2 answers

Force open of main activity

I have an android app chat. It has to be secure so I want to force my app to open always at Main Activity. This doesn't happen when I click the history of launcher, it opens the activity shown on launcher history not the main activity. How can I…
user168228
  • 11
  • 2
0
votes
2 answers

Gather Touches from MainActivity

I want to gather all the possible touches from my entire screen. I implemented a @Override public boolean onTouchEvent(MotionEvent e) { double x = e.getX(); double y = e.getY(); } But now I added a TableView to the "scene"…
L3M0L
  • 429
  • 8
  • 23
0
votes
2 answers

Is it possible to call the mainActivity class of another project ?

I have 3 android projects, which they have different functions. Each project has its own mainActivity class. Now I want to merge the 3 projects into one. I can think of 2 ways to do it. First way: open one of the 3 projects, then create new java…
Calvin Ng
  • 33
  • 4
0
votes
2 answers

how can i receive value from AlertDialog(class) box in MainActivity(class) without passing control to AlertDialog class(Android Development)

Description: I have created AlertDialogBox Class, when i need the dialog box to pop-up i use alertDialog.show(), dialog box pop-up takes input as YES/NO(button as positive and negative) and stay on the same activity, but how can i get the value i.e…
0
votes
2 answers

Android RuntimeException and NullPointerException from Login to MainActivity

I am new to Android programming and am trying to create a login. It seems that the login is successfull but after that the app crashes immediately. I think it crashes because of the intent but I'm not entirely sure about this. Here's the…
0
votes
1 answer

How to make button be visible only at the end of recycler view?

I have managed to make button visible all the time, this is ugly. According to new material design we should use RecyclerView not ListView, so i wonder how to make buttons only appear when user scrolls to the end of the list, but not visible all the…