i have 3 tab ( History , Upload, smth) in the "history" tab i have a listview that have data, i want from my "upload" tab where i have an edit text and a button, when i press the button i want the listview ,in my "history" tab , to be updated with what i wrote in the edittext.
I use SharedPreferences. Save it to SharedPreferences in the one tab, retrieve from SharedPreferences in the other.
Related
how can i set Text for while time and when one text will finished then automatically i want to show another text in one activity!
Can i do it in android studio ?
if yes then how ?
Show text for 3/4 second then another text will show there in one activity
call this inside onCreate function. we are using coroutine here. follow this link for more reference -> https://stackoverflow.com/a/62065829/8879652
lifecycleScope.launch {
myText.text = "text 1"
delay(3000L)
myText.text = "text 2"
delay(4000L)
myText.text = "text 3"
}
I am using jitsi-android-sdk in which when I go click home screen it takes me to the picture in picture mode and when I click on the app takes me back to the first form page. How should full screen the picture in picture mode when I click on the app?
what should I put in onResume() so I can full-screen picture in picture on click of the app.
For example, When we are using Netflix and watching a movie on mobile when we press the home button it enters the picture in picture mode and when we click on the app icon it fullscreen the picture in picture mode (return to the movie in fullscreen which we are watching)
I want to implement the same behavior in my android app.
The first check which activity is going to paused state when the app goes picture in picture on that activity onResume() method add this code.
#Override
protected void onResume() {
super.onResume();
SharedPreferences sharedpreferences = getSharedPreferences("MyPrefs", Context.MODE_PRIVATE);
//get boolean value from shared preferences which we are store when joining meeting button is clicked
boolean check = sharedpreferences.getBoolean(met,false);
if (check){
//if meeting is going on redirect to meeting
//Replace JitsiMeetAcitvity.class with your picture in picture activity class
startActivity(new Intent(this, JitsiMeetActivity.class)
.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT));
}
}
I have used the shared preferences to keep the track of the meeting is going on or not.
If you want to see in detail Follow this
I am a beginner and this is my first app.
I am making an app that will show the user Text View in the mainActivity.xml, ex.Music, then the user can click on the 'music' text View(via intent) , and it goes to another activity where are displayed several other text views.
ex. Rap, Pop, Rock, Punk ... each of these views can be clicked (with intent), and again it leads to another activity, where are displayed various sub-genres of let's say Rock, and the user can click on one of them and then it shows some text views with name of the songs of that genre and if clicked the final intent leads the user to the Youtube app.
The 'problem' is that I have to create new class and new activity for every genre, create text view with id in xml layout , define intent in the class with setOnClickListener and goes to another activity.
If i do this for every genre, I may need more than 200+ classes and layouts for the whole app.
Is there some way to make a one root layout xml, and just in every class use that layout but with different text in text views.
Also can i somehow reduce the number of classes needed for this ?
I tried with ArrayList<> to add the text in text views but i can't find the id so that i can call the intent.
You can send data trough the intent and then set this data to the textfield
In your sender Activity
Intent myIntent = new Intent(this, GenreClass.class);
myIntent.putExtra("genre","rock");
startActivity(myIntent);
In the receiver Activity
Intent myIntent = getIntent();
String genre = myIntent.getStringExtra("genre");
myTextView.setText(genre)
I am trying to create signUp form in android. Now I want when user select "user type" button a Edit Text in my form change to spinner. How can I do this?
I want to show selected images from gallery with gridview.
But, all the tutorial is just get image from project file..
like this..
// Keep all Images in array
public Integer[] mThumbIds = {
R.drawable.pic_1, R.drawable.pic_2,
};
I coded like there is add button, if users click it,
user can save name and photo. And if they save it, shows the photo with gridview..
those data would save in sqlite db.
How can I show the image from sqlite?