WHAT IS INTENT IN ANDROID?

john rob

Total Post:108

Points:756
Posted by  john rob
 1159  View(s)
Ratings:
Rate this:
what is intent in android
  1. Kamlakar Singh

    Post:194

    Points:1396
    Re: What is Intent in Android?

    Intent is basically a message that is passed between components (such as Activities, Services, Broadcast Receivers, and Content Providers).

    It’s also use for create target of another Activity. In Intent we can send data via bundle.

     

    Example à

     

     

    btnSubmit.setOnClickListener(new View.OnClickListener() {

     

                      @Override

                      public void onClick(View v) {

                            // TODO Auto-generated method stub

     

                            // TODO Auto-generated method stub

                            // Intent objIntent=new Intent(CurrentClass.this,

                            // TargretClass.class)

                            // startActivity(intent);

                            Intent intent = new Intent(MainActivity.this, Second.class);

                           

                            startActivity(intent);

     

                      }

                });              

    // It will open Second Activity.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!