public class Activity1 extends Activity {
billreminder br;//billreminder is a function in activity2
public void onCreate(Bundle savedInstanceState);
setContentView(R.layout.main);
br.read(c);//c is a string
}
how do we call read function.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are a couple of ways you can do this. You can make the function in activity2 a static function. You can then call it like so:
Activity2.read(c)Another way, is to pass an intent from Activity1 to Activity2 as follows:
in activity1:
in activity2 inside its onCreate method:
in activity1 again1:
Avoid subclassing the Application class. From the android docs:
Also, I think you are confused. You need to call a method on an object.
is wrong. I think you meant that br is an object.