java - Bundle and putExtra -


i new learner

when copy practicing code book bought, tells me putextra not defined bundle

can use putlong instead? or what?

public class remindereditactivity extends fragmentactivity { @override public void oncreate (bundle savedinstancestate) {     super.oncreate (savedinstancestate);     setcontentview (r.layout.reminder_edit_activity);     fragment fragment = getsupportfragmentmanager().findfragmentbytag(remindereditfragment.default_edit_fragment_tag);     if (fragment == null) {     fragment = new remindereditfragment();     bundle args = new bundle();     args.putextra(reminderprovider.column_rowid, getintent().getlongextra(reminderprovider.column_rowid, 0l));     fragment.setarguments(args);      fragmenttransaction transaction = getsupportfragmentmanager ().begintransaction();     transaction.add (r.id.edit_container, fragment, remindereditfragment.default_edit_fragment_tag);     transaction.commit();     }  } 

}

yes, can try putlong method, bundle don't have putextra(). putlong(string key, long value) - inserts long value mapping of bundle, replacing existing value given key. check see bundle methods: bundle


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -