Android App Development for Beginners – 36 – Sending Extra Intent Data

[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Posted

in

by

Tags:

Comments

41 responses to “Android App Development for Beginners – 36 – Sending Extra Intent Data”

  1. Shahab Ali Avatar

    Can you send an object using intents? By object I mean getting multiple values from the user and adding them to the object.

  2. String helloWorld; Avatar

    Hello everyone, I have a question: in 8:29 it is declared Bundle applesData = getIntent().getExtras();
    and then this data is converted into a new string:
    String appleMessage= applesData().getString("appleMessage");

    And my question: Is it wrong or can I convert the data into a string without using the Bundle class. For example:
    String appleMessage = getIntent().getExtras().getString("appleMessage")?

    PS Amazing videos! Thank you so much!

  3. Rohit Sharma Avatar

    how to solve Error:(22, 71) error: cannot find symbol variable MainActivityInput

  4. Khodkumbhe Awani Ramdas Avatar

    Hello there.can anyone help please?When i add the code line baconText.setText(appleMessage);
    the textview in bacon activity vanishes and nothing appears there.
    What could be the possible error?
    the code is exactly same as Bucky's.and my android studio version is 2.3.2

  5. Vandel Jason Strypper Avatar

    you are truly good
    just what i need
    not like those "tu du" indian crap

  6. ABHINAV ANAND Avatar

    What is the significance of View view….??

  7. Israel Palma Avatar

    Dude you are always making us hungry with all that bacon talk! Awesome tutorials.

  8. Darwin Pose Avatar

    Incase you will use intent with sqlite:

    //——Activity1———//
    String fullNameCursor = cursor.getString(cursor.getColumnIndex(CrudContract.CrudEntry.COLUMN_FULLNAME));
    Intent intent = new Intent(FetchActivity.this, MainActivity.class);
    intent.putExtra("fullnameIntent", fullNameCursor);
    startActivity(intent);

    //——-Activity2———//
    Intent intent = getIntent();
    String fullnameGet = intent.getStringExtra("fullnameIntent");
    fullname.setText(fullnameGet);

  9. TechStar Avatar

    Anybody facing the " App has unfortunately stopped" error, try the below try and catch statement:

    public void onClick(View view){

    try {
    i = new Intent(this, Apples.class);
    startActivity(i);
    } catch (Exception e) {
    e.printStackTrace();
    }
    Log.d(TAG, "IntErr");

    }

    ** Just a note here that I'm trying to go from my Avocado class to my Apple class. So you can change the above code according to your classes.

  10. Unlim ited Avatar

    ok if im getting this right using the onclick method you dont need to add the onclick listener , if this is correct why you didnt say that from tutorial one and we kept typing it? any reply is more than welcomed

  11. aimby619 Avatar

    the EditText object need not have a name same as the id in the layout xml file.

  12. OPTIMUS Avatar

    Already have second activity added also have the parameters added still gives me app has stopped error.

  13. Koray SARIOĞLU Avatar

    What if we want to switch with a smooth effect like we did before button place and size example.
    Transactionmanager.begindelayedtransaction does not work with this one. How to ? ^^

  14. HK Tutorials Avatar

    Believe me you are AWESOME BUCKY !

  15. Amit Kharel Avatar

    This is only for sending string along.. But what about sending image.
    What code is needed to send image along…Can anyone help.

  16. Mohammed Uddin Avatar

    What i wanna know is, how to pass String-Array, i'm having a really huge trouble with it.

  17. ianni tsoumas Avatar

    Gongrats man,great tutorials.I would like to ask if withi this technique i also can change a TextField or an image of another Activity when i click a button,i v been trying to do this for days but with no result,any suggestions will help,thanks again

  18. maryam dashti Avatar

    I have problem with this line of code in apples.java class
    final EditText applesInput = (EditText) findViewById(R.id.applesInput);
    // compiler says that: Unexpected cast to EditText: layout tag was TextView But if I use TextView instead of EditText , I can Not write any thing into plain text , so I have to use EditText!!Plzzzzz help me!!.

  19. Asmit Bhantana Avatar

    can any one help me with this

  20. Asmit Bhantana Avatar

    08-22 09:11:00.164 22559-22559/bhantana.intenthandler E/AndroidRuntime: FATAL EXCEPTION: main
    Process: bhantana.intenthandler, PID: 22559
    Theme: themes:{default=overlay:com.blissroms.moelle.ddoverhauled, iconPack:com.blissroms.moelle.ddoverhauled, fontPkg:com.blissroms.moelle.ddoverhauled, com.android.systemui=overlay:com.blissroms.moelle.ddoverhauled, com.android.systemui.navbar=overlay:com.blissroms.moelle.ddoverhauled}
    java.lang.IllegalStateException: Could not find method onClick(View) in a parent or ancestor Context for android:onClick attribute defined on view class android.support.v7.widget.AppCompatButton with id 'appleButton'
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.resolveMethod(AppCompatViewInflater.java:327)
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:284)
    at android.view.View.performClick(View.java:5204)
    at android.view.View$PerformClick.run(View.java:21158)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5471)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

  21. archie rombo Avatar

    Getting following error when launching app after 2:13 minutes of this video

    Could not identify launch activity: Default Activity not found
    Error while Launching activity

  22. starmanL0L Avatar

    For those whose app crashes when they want to change the activity, even if they included "Viev view" in the onClick method:
    For me AS 2.1.2 does not declare the created Java classes in AndroidManifest, you have to do it manually. So open up AndroidManifest.xml, and type in <activity android:name=".SecondActivity"></activity> inside the <application> tag (of course change the name of the activity to what you have). This worked for me.

  23. Nathaneal Greene Avatar

    Bundle applesData = getIntent().getExtras();
    if(applesData==null);
    return;
    }
    String appleMessage = applesData.getString("appleMessage");
    //Error here ^
    Getting an error saying "Cannot resolve symbol applesData to a type"
    Anyone else have this problem or know why it saying this?

  24. manzai1994 Avatar

    hello guys, can anyone tell me the differences between create a clickListener at .java and android:onClick="onClick" at .xml?
    because from my understanding, both of these are doing the same job.

  25. shekhar sachdev Avatar

    at 00:40
    bucky: since all we did is(pause)
    me: care for each other
    #lean on

  26. Ay men Avatar

    for all those facing the problem of "app_name. has unfortunately stopped" add View view to the parameteres of the onClick activity it worked for me example : public void a(View view) {
    Intent i;
    i = new Intent(this,bacon.class);
    startActivity(i);

  27. ريم الجابر Avatar

    :(? " i did the same thing .. but when i click on "go to bacon" it shows message"unfortunately application has stopped

  28. Wroztee HS Avatar

    I have a problem. When I type this in my mainactivity.java the program marks it red and says: Cannot resolve symbol 'view'…
    public void onClick(View view){
    Intent i = new Intent(this, bacon.class);
    startActivity(i);
    }
    Please can someone help me. I also tried to replace view with only v and the same error again…

  29. Pontus Rapp Avatar

    It is funnier to do it both ways. That when you send to Bacon you can see what the person wrote and write back without changing the Title from Bacon as Bucky did. Then send it back to Apple where you can see what u wrote in Bacon in Apple without changing the title and send back to bacon. Then u can send back and forward

  30. bahnfahren Avatar

    When switching there seems to be a new Activity created every time. The memory usage always rises when you switch. Is there a way to only create an Activity once and then change between them?

  31. MadApples WA Avatar

    Getting into the fun stuff 😀 woot woot!

  32. srivastava18 Avatar

    The app crashes when run and shows the message "app_name.unfortunately stopped"

    Any help would be appreciated.

  33. Cojoc MC Avatar

    This video was really intents !

  34. thesupercar_stalker Avatar

    Fantastic Video Bucky! you really explained things very well, and I learned a lot! thank you from Ireland

  35. Rohan Anand Avatar

    Thanks a lot Bucky, you are a fucking legend.!

  36. Afridon Dyer Avatar

    cant you just double tap on a button to write the code for it to take you to the next page?

Leave a Reply

Your email address will not be published. Required fields are marked *