I have 2 activities. Initially the button in first activity is invisible. What I want is that when I click a button in the second activity then the button in my first activity should become visible.
This is my second activity code till now.
this.promodeimage.setOnClickListener(new OnClickListener() {
public void onClick(View view) {
///What should i do in here
}
});
You can use something like this whenever you need to implement your logic.
Good Luck.!
In your First Activity, check in the onCreate() using
To solve this problem make your button static in your first activity like:
this way u can get to the button in ur second activity like this:
Hope this solves your problem.
Do one thing ! its easy .. just make the button in your first activity as public static
Now all you need to do is that from Second Activity just access it using the class name of the first activity i.e Activity_One.btnOne
Let me know if this works for you ! :)