Android: getIntent() is deprecated -


my program consists of mainactivity , 2 fragment activities. need 1 fragment take string value user , pass second fragment.

i trying wrap head around how this. since familiar intents, found this answer on post , decided try out. looks fine until step 4, when try use intent i = getintent(); in second fragment, studio won't let me use , says "getintent(java.lang.string) deprecated".

this doesn't make sense me since have used getintent() in other programs without issue, , letting me use in mainactivity (step 2 other post) without screaming @ me.

i know can done without using intents, can't figure out , can't find thorough tutorials in order so. guess questions are:

  1. can make intents work purpose still? should around deprecation issue?
  2. any other advice, explanations, or links "explain i'm 5" tutorials helpful , welcome. have googled , read few, still not understanding , becoming increasingly frustrated. seems should relatively simple concept.

it late answer still providing answer other persons. happen because intent work activity. , fragments not activity, attached activity. need this:

intent intent=getactivity().getintent(); 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -