Android-activity Questions
Ad
How can i keep status 'online' in android
Now i'm trying to make like a instagram chat program using firebase the problem is i want to show that member login status but android life cycle
How create a generic activity context?
I have the next part of code in which i need to know from what type of activity was the context passed: activity activity;
Android Handler updates TextView only with last setText()
The following code is from head first android. it is for a stopwatch app. i have a few questions in the following code: the
How to pass data from one activity to another activity
I'm creating an event app which contains a list of events in recyclerview. the events recyclerview consists of
Is there a workaround for launching an activity at ACTION_POWER_CONNECTED on Oreo?
I'm currently developing an app for a client that is supposed to launch when it's charging. the only way that i know to do this is with the
How to get access to third party sdk's activity names
I need to know when the screen gets visible in the app how can i get to know which activity is related to that screen. especially if i'm using
Is there any way to disable deep link on Fragment?
I implemented an app using nfc which has url link. so, when nfc is on, the mobile detects url and opens my app. i made it happen like
show existing navigation menu connected to one activity in another activity
I am in the process of building an app and have a navigation menu in my first activity, however, when i go to the second it doesn't show, so which
How can i transparent from activity to fragment?
Now i'm trying to the transparent opensource expandable layout but the problem is that source made by activity but i want to apply my fragment
Ad
Do i need to create activity for each page in android?
I'm creating an android app in which there will be around 20-25 screens. if i create an activity for each screen it won't be feasible. what should
Changes are not applied to all the activities
I implemented night mode in my app.user can change the night mode settings in profile activity.the order of activities are as follows.
Intent error when I click the button - why?
I am having troubles and i can't figure out what the problem is. there is no alert in my code, neither a red line or something.
How to include an unattached View in the activity transition?
I draw a view that is not attached to any parent. it's a decoration for a recyclerview. the view sticks to the bottom and disappears when
Passing data to Fragment before destroying Activity
I've activity a -> fragment a [from fragment a i decide to create activity b]
How to show ProgressBar in centre of screen regardless layout types
I wonder if there is any way to show a progressbar at the middle of the screen programatically regardless the type of layout of the
How to change activity image and text according to listview item click in android studio ? java or kotlin
I'm making an android application for information of different places. there are more than 200 places. so creating each activity for each place is
Pass data from activity back to already created fragment
Bank app: i have a navigationdraweractivity which has more fragments. each fragment is created after menu item is clicked.
How can I pass parameters between two Activity but one must only support the first one
I have an activity that very quickly has to process data and then return to the previous activity, i give an example: i have a mainactivity class
How to close second activity including a fragment?
I have a mainactivity where i start (via button click) another second activity: val intent = intent(activity,
How to start activity in adapter
What i am trying to do is start an activity in my adapter but it seems that i'm getting an error on my other adapter.
Ad
Kotlin- Function runs after next lines ended
Updated- the code in the question works now i'm trying to run a function after clicking on a button. the function updates an array and i
When should we call getContext and getActivity once and for all?
I searched a lot on stackoverflow and more generally on google for explanations about the use of contexts in the android environment, but i
Is it possible to create a recents screen like in android for the activities of my app
I am trying to make an activity which will hold all the recents screen in my app not in the android device. the idea it is to create
Android Sqlite App crashes in Android pie and above Gives SQLiteDiskIOException (code 522)
I'm trying to backup tables from my database when onupgrade method is called. i' m using the solution provided here
How to implement a reusable multistep state-machine into MVP?
In my android app i have a multi step login procedure: enter a id, and send to backend: firstcall(id) if id
How an Activity is killed by Android?
As we know android would kill a paused activity in some conditions. and there is a fifo back stack of activities.
Transition and animation like YouTube
So i've been learning and working with android transitions and animations. so i would like to know how can i achieve
Change text content depending on button clicked within the same class
My problem is exactly like this link
Android Navigation Drawer with multiple Activity
I am trying to create a baseactivity with navigation drawer and extend it in other activities so that i can reuse the the navigation drawer
Going back few activities without destroying the bottom one
I did a simple sample with 3 activities: activitya activityb
How to use own layout for navigation drawer activity instead of auto generated layout?
I have a navigation drawer activity, that have automatically generated these activity_student_home2,
Ad
finish() method is not working from OptionsItemSelected method in Android
I am trying to call the finish() method to close the activity when the user inserts nothing in the edittext field and
Wrong Activity is getting openned on clicking Notification
After clicking on notification, wrong activity is being oppended - main application activity, but not my goal activity - nearphotoactivity.
Full screen activity force to adjustPan
Have some problem with fullscreen activities, in all activitis i use the code below to make it fullscreen.
how to not lose any data in the first activity when you use intent
Okay lets say we have 2 activities such as mainactivity(ma) and secondactivity(sa) ma is the user interface that takes name,number from the user.
Activity result code always 0 (cancel) when there is two or more activities to handle intent
I have a problem, when i startactivityforresult to take picure, resultcode is always activity.result_canceled (0) if there is two or more camera
Keep activity while the app is not on top of screen
I got a problem with multitasking, its probably a stupid question but after looking for hours an answer, i dont know how to do it everybody seems
Send data based on Button in Android Studio
I have 2 activities. 1st activity has got 3 buttons. these buttons have text as c1, c2 and c3. for example, if i click button2, second activity
How can i get list of all running activities and select any activity from pause to start state?
I have an app and i want to get all the running activities list in the listview and select any activity from the list and that activity will go to
How can Google's own MapsActivity result in a ClassNotFoundException on a Samsung phone?
I got the strangest error in my google play console yesterday. i have a button that opens up directions in the google map app. had it for
How to set theme on first and second activities programmatically?
I'm create app with 2 activity and want set theme onclick button in first and second activity. method settheme() work only on first
How to build a notification in android and implement click listener?
Hello friends i am creating mp3 player application my application is successfully build i want implement click event notification when user goes
Ad
Can I access variables, methods of an Activity Class from a Non-Activity-Class?
I want to operate some functionality of my activity class from another class. because my the number of codes in activity class is increasing and
How to increase the width and height of an picture?
I have an activity with no layout. i set it like a theme directly in androidmanifest:
Where to put method used in XML when it is infalted with layoutinflater?
I have 10 similar buttons in a layout (create_new.xml) which will be distinguished based on the tag attribute: <button
Providing custom activity name instead of main activity in android studio while creating new project
I have just started learning to use android studio and using examples of login and registration codes given in various blogs. problem:
Android Studio says"Mainactivity is not declared in AndroidManifest.xml"?
This is my manifest file when i run the app it says "main activity is not declared in androidmanifest.xml" i tried rebuilding,invalidate
Android. How can I jump to a system's activity with a '$' symbol in its path?
In my application,i want to jump to the system's location setting page. by running adb shell dumpsys activity activities | grep
Getting null while passing data through a bundle from Activity to Fragment
Losing data on the way when passing it through bundle, i get attempt to invoke virtual method 'java.lang.string
Android 9 back button when launching settings activity works incorrectly
In our application we have a special buttons which takes the user to network settings page. we use the following code intent
How to access the activity from within a service in cordova plugins?
I'm building an app with cordova and right now i'm focussed on a background service. i need that service for notifcations and to update them
What is the correct use of an onClick method in fragments to open new activities?
Re-edit: for those interested the method for onclick was resolved below. turns out you cannot create separate classes for controls so the button
How to override method from extend activity?
I have 2 activity. one is alertdialogactivity & second is mainactivity. i extend alertdialogactivity in
Ad
Set a particular email id for new activity
I want to set an if condition in an android studio. please help me to implement this. logic like this if (emailid =
OnActivityResult not getting called in Fragment from Activity
My flow of activity is like this. in fragment a, it allow user to capture image, and the image will be displayed on
Fragment color - -how to set it to transparent?
What will be better: set transparent color in the fragments and then use color from the activity_main.xml or set color
Saving activity's state with onSaveInstanceState() and ViewModel
I was left with some questions regarding viewmodels after reading this:
Android activity lifecycle - what happens after onStop() and when onDestory() is called
I wanted to ask about the activity's lifecycle. if an activity is going to the background, or the user pressed the home button so the
Why is FirebaseUser DisplayName not updating?
My firebase authentification is email based (login and registration requires just an email and password) that firebase manages afterwards.
How to trigger override methods after button press?
I want to override onbackpressed() but after onclick event. @override public void onbackpressed() { //toast
Passing data from a Fragment to another one
I known, that this question is already exist in this site and others, but i still try find a solution, because so far every solution is failed.
Using activity alias does not reflect on app icon
Trying to use activity-alias for using multiple icons for my application. this is my manifest code : <activity
Use cases of Context in Android Development (Fragment, etc)
In the time i have spent learning android development, i have realized that the use of "context" is a common theme in nearly everything we do.
Handling (many) Back stacks
I have an app that has an specific task process of 3 steps, which are 3 different activities, when the process is done, there's an activity that
Ad
Displaying a toast without window
My application is unusual: when it starts up, it simply displays a toast message. that is, i have to click on the launch icon, see toast and
How can start a activity in the ViewModel?
I am using mvvm to develop a app, but i cannot start activity from androidviewmodel. in layout i have a reference to the androidviewmodel
While i am switching between activities my Application is blinking and showing previous activity in background
We have homeactivity which is navigationdrawyer activity where there are many options like jobs and policies.if he clicks on jobs for the first
No view found for id in a new activity
I have created an activity that i am using for barcode scanning. the oncreate looks like this: public class
Detect Activity Launch
I am using an external library in our project. that library showing notification. on tapping that notification starts activity in the library.
Passing data from second activity to third activity
In this program i have three activities main, second and third. when the app opens there is a blank textview and button. selecting that button
Communication between two activities using interface not working as expected
Problem: on sending data from activity2 to activity1 using interface results in non-assignment
SecurityException: Permission Denial: While launching Activity via explicit intent
I was reading about declaring
How to delay a timer on an activity launch?
I have implemented a simple timer with countdowntimer on my game and i need it to start ater a few seconds when the activity is started.
Why in Android documentation Activity classes have static modifier
If we open android
Android: Killing an activity
I have an activity where a user put his nickname. i want to not be able to go back after this. i have tried everything but no luck. tried so far
Ad
Create Instant app for existing application
I have an application that i want to create an instantapp for it. i successfully apply changes to my project and it builds
What is faster Communicating, sending broadcast VS calling activity method directly in Android?
In my app, i have to call an activity method from the fragment. i know i can do this in two ways: 1. via sending a
Open Notification message from FCM as link/URL in Android Application if there is URL in the message of Notification
Push notification code using fcm sends title and message as notification text in android and when i click on the text, it takes me to the app
[email protected] vs [email protected] in kotlin
As you may see that [email protected] or [email protected] is valid while starting activity in
How to call a method from adapter in activity?
I just want to call a method (which is declared in an adapter) from an activity . is there any possible way to do it?
Is the activity stack saved to disk deleted If the app isn't opened again within a specified amount of time?
App is killed by os(low memory) and it's activity stack is saved to disk. if the app isn't opened again within a specified amount of time, is the
How to call this function from other activities?
I need help in this kotlin code pls ... i have checkconnctivvity() function and it's working perfectly ... fun
Android Fragment to replace original contents in activity?
Activity_main.xml: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.constraintlayout
Conflict between final field, constructor and onCreate in Android Activity
First, i've been looking for the answer all over, but didn't find anything that can explain how to resolve my case. i want to declare a
Activity Lifecyle Difference in Device's Back Button vs Actionbar's Back Button
I'm currently learning the activity lifecyle. i noticed the following: i have two activitys, a and b. when i open
Reuse methods in Kotlin, Android
I need to open one activity from several different points in the app. let's say from settings fragment, main activity and navigation drawer
Ad
Android OnBackPressed Call Activity Two Times
I have a problem in my application when i click back activity called two times , when my application idea is : 3 activities
When pressed back button, my app dismiss recent apps
When my activity is running if the user presses backpressed, the activity is dismissed and it is not visible in the recent apps list. i want it to
Unable to find the class on dex path list
I see a lot of questions like this but none of them helped me to solve the issue. what's my issue is android studio able to build apk
How to get previous activity in android Kotlin
Lets say my default activity is mainactivity and i start another activity depositactivity without using
onKeyDown() event not triggered when in DialogFragment
I capture key events (from an external keyboard) within my app. i use onkeydown() method from activity. in my app i
Android: how to quit an activity without closing it when click on back button?
I have a subactivity that can be open from my mainactivity. for some reasons, when the user clicks on the back button go back to my
Activity has been stopped
This is the code when i apply that code application has been stopped occurred this code is to find relative prime in android application
Loading a fragment upon a specific condition
I have an issue please help me out. i am building an android application and i have successfully integrated rewarded video ads to it. i
How to display a View in Full Size on screen in Xamarin Android?
I am unable to set the view size matching the display size, below is the code, it is a transparent view
How do you start a new window activity in Android Studio?
I tried several things, such as: intent i = new intent(this, myactivity.class); startactivity(i) where it tells me
Handle activity back stack
I have 4 activities: mainactivity (launcher) - checks if user is logged in then start containeractivity else introactivity
Ad
Singleton Fragment or save web view state
Here what i want is i have a fragment inside an activity and it has a web view which is basically chat to customer service. this activity will be
Going back from a navigation drawer activity crashes the app
I'm learning how to make an app with google sign-in capabilities from the tutorial
Ad
Blog Categories
Ad