The main activity is the one which starts before the other ones.
Questions tagged [main-activity]
201 questions
0
votes
1 answer
How to pass Bitmap from activity to Adapter
I want to pass a bitmap from one activity to an adapter.In my Main activity i have the following:
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if(requestCode == PICK_IMAGE_REQUEST && resultCode…
user8934311
0
votes
1 answer
Can't share the exact image, previous image loading while sharing through any app.Classes are here below
Here in image slider with viewpager app when I want to share 5th image but after opening WhatsApp or other app there is 4th image attached.
This is the main problem
and another problem is it doesn't work with android 7 or more, there WhatsApp…

Seema Kapoor
- 1
- 3
0
votes
1 answer
Refresh Main Activity when my Bind Service changes its state
I need to refresh Main Activity when my Bind Service changes its state. Code for my MainActivity :
public class MainActivity extends AppCompatActivity
implements UDPService.OnHeadlineSelectedListener{
protected void onStart() {
…

Davide
- 7
- 5
0
votes
1 answer
Passing a string from an event to MainActivity in Android Xamarin Visual Studio
The project is done in Visual Studio with Xamarin and targeted for Android.
In my simple project I have 1 activity (MainActivity). Here I create an instance of a Scanner object that will sit in background and listen for iBeacons. Once the scanner…

public-profile
- 17
- 2
- 7
0
votes
4 answers
"Error running app: Default Activity not Found"
I'm programming an app with sqlite+JSON, but suddenly I couldn't Run it anymore, and it popped this message, here's my AndroidManifest.xml , Idk if there's something wrong with it, my main activity is called DatosActivity, I wish you could help…

Aramis Delgado
- 45
- 7
0
votes
1 answer
Is it possible to add a button to an empty MainActivity in android?
I have an empty Activity_main layout. I want to add a number of buttons that have to be a certain % of the screen width and for this reason I want to add them programmatically. Every example on this site uses a LinearLayout. Is it possible to add a…

Pizzarius
- 51
- 5
0
votes
1 answer
Pass variable from Recyclerview-Holder to Mainactivity
I tried a lot of things but I can't get it to work... I try to pass this String Variable (when i click Item in RecyclerView) to my MainActivity.
What works bad is calling the function (OnRecyclerViewItemClick) and changing the…

Jose
- 401
- 4
- 15
0
votes
1 answer
Access to SQLiteOpenHelper created in MainActivity
I have created a SQLiteOpenHelper object in MainActivity:
public class ExchangeActivity extends AppCompatActivity {
public CurrencyDBHelper db;
private Handler handler;
private int delay = 30000;
private DataHandler…

Anton Prokopov
- 639
- 6
- 27
0
votes
4 answers
how to display title Bar on activity
My question is maybe stupid but I'm a beginner
I have create navigation drawer application in Android Studio with two Activity. In First Activity ( MainActivity), this activity Show Title Bar but the second Activity(Parametre) does not show…
user7996504
0
votes
3 answers
Display Admob Interstital only at open app
i ve add a interstitial function on my app, it works great but the problem is that if user swype from portrait to landscape, the ad showing again. The ad showing causally and this breaks the google rules.
How i can set the interstitial Ad only at…

user3057363
- 11
- 2
0
votes
1 answer
How to connect two activities to make a program?
I am a beginner in java.
I want to make sure to link my second main activity on my first activity.
I try to put a line of code in my first activity but that does not connect anything at all.
I put the line of code:
Intent intent = new Intent(this,…

Enitoup
- 3
- 1
0
votes
2 answers
Accessing main activity in Broadcast Reciever without using intent
I am stuck in a problem. I have a broadcast receiver that calls the method of class takes in context and main activity reference in constructor. I dont know how to access main activity in broadcast receiver.Here is my code:
public void…

exceptionnotgood
- 31
- 8
0
votes
1 answer
Constructor flagged inappropriately 11 after Android Update
Since I flashed to Android 7.1.2 my own App crashes with this errors:
art Failure to verify dex file '/data/app/com.lolxdfly.flyengine-2/base.apk': Constructor 33473(Lcom/lolxdfly/flyengine/GLUtils/WndDebug;.) flagged…

lolxdfly
- 381
- 1
- 3
- 13
0
votes
2 answers
Main activity code disappeared after a force laptop shut down
I was writing an app and I was in main activity (had written thousands of lines of codes). But when I wanted to shut down my laptop, it took a while so I had to push the power button to force a shut down. Then after a while, when I powered on my…

Sina Ahmadi
- 21
- 1
0
votes
0 answers
Android Studio MediaPlayer stops working after a while, why?
Hey I created a Soundboard with 200 Sounds but when I click a lot on the buttons the MediaPlayer stops working although I clean up the MediaPlayer.
Here is the code with only 2 Sounds:
public class MainActivity extends AppCompatActivity{
public…

Aaron Waller
- 175
- 4
- 21