Most voted "android-activity" questions
Activity is a component that provides a graphical interface (UI) to allow the user to interact with the application. Use this tag for questions related to the functionality and responsibilities of an Activity, such as its life cycle.
Learn more…373 questions
Sort by count of
-
1
votes0
answers288
viewsHow to take a variable from another class in Kotlin?
I want to take a variable from one activity and use it in another class. This variable will be filled by a user in an editText called editTextSerie override fun searchSeries(listener:…
-
1
votes1
answer33
viewsSave values and make a comparison
I’m having a hard time making a comparison logic or something better that you can point out to me. I’m developing an app that contains several buttons in mega sena game format. I need to make sure…
-
1
votes1
answer427
viewsHow to send data between Activitys without opening another window? Android Studio
Good afternoon gentlemen, I have a question in my code, I need to pass the data from one Activity to another but when I put the value it opens the same screen twice, it is working but when a value…
-
1
votes2
answers236
viewsFind out if Activity has been closed
Good night! I’m a beginner on android and I’m developing a chat app where two users connect through a queue based on their chosen preferences. When one of the users disconnects from the chat (end…
-
1
votes1
answer320
viewsDestroy fragment on return
I have a NavigationDrawer with many menus on Navigation all open as fragment, when I open a fragment and return it returns to the home screen and if it comes back again close, blz ta correct. But if…
-
1
votes1
answer525
viewsCreate a fullscreem and untitled splash
Hi, I’m initiating on Android Studio, and I’m having a question. How to make my splash stay with the image in full screen and without the title bar? My image PNG has 750 x 1334. Follows my code:…
-
1
votes0
answers53
viewsError calling screen by boot
Error in the button, simply close the application in the emulator when press to open another Activity, already everyone came to try to solve and nothing, follow the Logcat and the classes ( the…
-
1
votes0
answers22
viewsError using startActivity on Fragment
I want the Button (tutorialeme) that is inside the "emergency" Ragment to have a CLICK action, and in this action I want him to call the Activity "tabbed_warning", the error is in Intent,…
android android-activity android-fragment android-xmlasked 5 years, 4 months ago Matheus Vidigal 33 -
1
votes0
answers92
viewsReading an editText - Android Studio
I have a app where a json is read and returned in a list all items in this json. I’m using the ADAPTER to do this, I put a EditText on the screen, this editText is replicated to every json read…
-
1
votes2
answers331
viewsWhite screen before splash screen startup
I created a Splash Screen that works normally, but when opening the application instead of directly entering Splash, it runs a white screen. Splash.xml <?xml version="1.0" encoding="utf-8"?>…
-
1
votes0
answers25
viewsHow to pass an object (instance of a class) from Mainactivity to another activity (Mainactivity2) on Androidstudio
Superherofeatures is a class with all the attributes of a superhero, such as name, birthday, power and many other things. Now the heroSelected instance is working, but I can’t transmit it to the…
-
1
votes0
answers98
viewsQuestions about using Appbar + Toolbar + Fragment - Android Studio
Hello, I have prior knowledge of Java but I’ve just started programming for mobile on Android Studio, someone would tell me if there’s any way to use Appbar + Toolbar (for the sake of design itself,…
android android-studio android-layout android-activity android-fragmentasked 4 years, 8 months ago Davi Massini 26 -
1
votes1
answer57
viewsDoubt about Android Activity syntax and the "onCreate" method and what are its arguments!
I’m new to the programming world and I’ve been studying java. I’m wanting to understand the Java application for Android apps and came across these methods from Activity. The theory I understand…
-
1
votes1
answer58
viewsHow to access an Activity by clicking on the notification without losing the data
Hello, I would like to ask for help because I built an app with a stopwatch and after a long time managed to enable notifications for Android Oreo+, but I can’t access the stopwatch Activity through…
android android-studio android-activity android-notificationasked 4 years, 1 month ago Nathan Nathan 21 -
0
votes1
answer175
viewsListactivity does not work Android
I have an Activity with a button calling a List Activity. This Listactivity quickly creates a string list, I just want to show this list on the screen and display the selected item in a Toast. But…
-
0
votes1
answer125
viewsWhy does Mainactivity inherit from Actionbaractivity?
I’m creating a new project and my Activity appears as ActionBarActivity: public class MainActivity extends ActionBarActivity someone knows why or how to tidy up?…
-
0
votes2
answers3914
viewsWhat are the life cycle stages of an Activity and Fragment?
What are the life cycle stages of an Activity and Fragment? What are the differences of these stages? And how can I identify at which stage an application’s Activity or Fragment is currently?
-
0
votes0
answers62
viewsActivity moves on Android
I have developed an application similar to 2048 and it is working apparently well. But there’s one detail that’s bothering me. 1 - I have a screen(Activity) at the top of the screen I have several…
-
0
votes2
answers325
viewsError to call Activity
I’m having trouble calling another activity. Follows code from Activity: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
0
votes1
answer157
viewsWhat is the best way for an Activity to call itself?
The app displays random questions by following as template to QuestionsActivity, that is, the user chooses true or false and will only change the question (textView) and the screen design will…
-
0
votes1
answer313
viewsError when trying to open a new Activity
Well, I have the MainActivity which has two buttons, I’m trying to do something simple: When you click one, go to a Activity, when you click on another, go to another Activity. This is the…
-
0
votes4
answers374
viewsIs it recommended to use more than one Activity in an Android project?
I always use several (in large project with web service and everything), the ideal is to use only one or no problems use several?
-
0
votes1
answer826
viewsPass object for error parameter - Android Studio
I am trying to pass an object per parameter, but an error occurs on the line "it.putExtra("tag", obj);": Cannot resolve method (java.lang.String, my.minhaClasse package) Follow the code Obj obj =…
-
0
votes0
answers161
viewsHow to use another class for the same layout
It is as follows: I made adaptations in the codes in order to work the Slider Menu style so I had to use the Fragment interface, as shown in the code below, but in this same layout in this case is…
-
0
votes1
answer180
viewsNavdrawer using activities instead of Fragments
I’m trying to implant a Navdrawer in my app but the example that I saw uses Fragments instead of Activity that I was already using, I found a block that deals with the Fragments. Part of the code…
android android-layout android-fragment android-activityasked 9 years, 10 months ago Allan Chrystian 483 -
0
votes2
answers4140
viewsError opening Activity: The <application> stopped
I have a file VigasFragment.java with a button that when touched should open the Activity VigMetBiapsb.java, however some error occurs, closing the application. Vigasfragment.java: public class…
-
0
votes1
answer59
viewsSkip User registration activities already logged in the application
Good afternoon. I wish I knew the best way to jump Activities of registration when initializing the application on Android when the user is already registered in the application, as occurs on…
-
0
votes2
answers162
viewsAndroid getIntent error
Hello, I have an application that I need to send data of a Activity to another Activity. I tested several ways however all failed, but in another project one code worked normally, but in my current…
-
0
votes2
answers444
viewsWhat is the correct way to call a method from a class that inherits from an Activity?
Because if I instantiate the class with "new" and call the method equal to Java it doesn’t work. I have a class that inherits from an Activity and I needed to use her method in several classes. Does…
-
0
votes1
answer2075
viewsHow to call a method another Activity in my Activity?
I have a activity A and a activity B. Activity A has the method metodoUm and I needed to use this method on Activity B. Does anyone know how I can do this? I would be very grateful. I’m getting…
-
0
votes1
answer158
viewsHow to remove automatic items from an Activity
In Android Studio, when it comes to creating an Activity, the IDE already places some items inside it, such as that circle with an envelope inside (image). How do I remove it after created the…
-
0
votes0
answers83
viewsActivity with bug that is breaking the layout
There is an Activity that gives a bug once in a while, it gets the appearance of the image I posted, then when I click on it, it goes back to normal, but this is random, there are times that do not…
-
0
votes1
answer104
viewsLaunch Exception on the onCreate of an Activity
I am working on the development and refactoring of some Activity's that has similar behaviors in our projects, so to avoid code repetitions, for common functionalities, I created some Activity's…
-
0
votes0
answers1073
viewsLoad an Activity inside a Fragment with tabHost
I’m starting with the android studio reading some things and watching some videos on youtube, basically what I intend to do is a calculation program to make my life easier in my service, some simple…
java android android-studio android-fragment android-activityasked 9 years, 4 months ago Túlio Barata 11 -
0
votes1
answer287
viewsHow to pass data to Activity itself after the camera is called?
I have a Activity with a EditText and a Button. When the button is clicked, the typed text is saved in a Activity and the camera is opened with the method startActivityForResult(). When the user…
-
0
votes0
answers497
viewsFix position of Relativelayout in Activity
Good afternoon. I want to fix the position of two RelativeLayout on the screen, but when the user changes the text of the TextSwitcher the RelativeLayout the one it belongs to increases in size, and…
-
0
votes1
answer62
viewsConditional Change of Activity
Hello, I have a problem, I want to create a conditional on an Activity, inside a button, to open another Activity in my app. But how would that parole? My app has buttons in main Activity that leads…
-
0
votes2
answers220
viewsChoose which Fragment will be shown in Activity
I have a Activity that the email is requested and if the email exists I show a Activity with a Fragment for entering the password. If this email n exists, I want to display a Fragment, in this same…
-
0
votes1
answer105
viewsError when using activities in a child package
I have a problem in my Android project on Eclipse. After implementing the functionalities, I reached a total of 10 activities and 8 other classes. From there I realized the need to structure the…
android eclipse android-activity packagesasked 8 years, 10 months ago Gustavo Almeida Cavalcante 189 -
0
votes1
answer268
viewsClose two activities
I have two activities that are called in the following sequence: The first one is inserted a text and once clicked on a button, it leads to a second Activity. This second Activity, when clicking on…
-
0
votes0
answers111
viewskeep the data in a variable of the first Act after returning from the second Act by the up button
I have the following problem , I have a list view in act1 q depends on a variable to be loaded, when I finish my act2 or go back by the back button of android (bottom button) the value of the…
-
0
votes1
answer1745
viewsPass data from an Activity to a Fragment
I need to pass the String result that is in Homeactivity for Mapsfragment, but I do not know how to do, I am beginner and do not understand much about the subject. Homeactivy package…
-
0
votes2
answers724
viewsPass a string from an Activity to a fragment maps
In Homeactivity, I get the string result from the server, it contains all the data I need, separated by comma, so with the method I tried to pass to the Fragment of this error FATAL EXCEPTION: main…
-
0
votes1
answer1273
viewsKnow if Activity is open (Broadcastreceiver or service)
I would like to implement a function that can check if Activity is open, because when I receive the notification through GCM (Google Cloud Messaging) if Activity has opened will only upload the…
-
0
votes1
answer111
viewsAndroid Dev. Null Pointer when accessing a button of a Fragment by main Activity using set contentview
I made the layout of an application where I use the android menu. Menu is on main Activity: @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The…
-
0
votes1
answer115
viewsPass an Activity company id to another and use in a database connection
I am passing a user id through an Internet and intend to use this id in the second App. Even I believe it’s correct Take a look at the code: I have to go from Activity to another user id:…
-
0
votes1
answer45
viewsSending Arraylist and General value to another Activity
I am creating an Activity, for example A and in it I have to add data of Releases (This class I Serialized), as name, type, etc... and I add also the updated general value on the screen and I have…
-
0
votes0
answers33
viewsCall error
I’m using the Fragment and making adaptations, as in getIntent() ... Inserting getActivity() as was explained by a user, in other times that was informed was useful and worked, but this time an…
-
0
votes0
answers66
viewsError printing given in an edittext
I am stuck to a problem, I have to receive values in three radiogroups to make the calculation of more 3 edittext along with the result of a method, the method works perfectly but the final…
-
0
votes1
answer120
viewsWhy does the app close when I start Activity?
I have in my onClick method the button to open the Activity within the Registersreadyoactivity, as follows. Bundle args = new Bundle(); Intent i = new Intent(CadastroProntuarioActivity.this,…