android - parent-child relation NOT returning parent name using NavUtils.getParentActivityName(this) in child activity -


i have 1 activity called a. , starting activity b this

 intent i=new intent(getactivity(),b.class);     i.putextra(bfragment.extra_crime_id, c.getmid());     startactivity(i); 

the above code assumed activity a parent of b.

but when try access name of parent a in activity b this

navutils.getparentactivityname(this) 

it giving me empty string. why this. when start new activity using intent, dont mean a parent of b

how can access a name? how can create parent-child relationship?

parent relations should marked on manifest, following code:

 <activity android:name=".b"             android:parentactivityname="com.alex.myapp.mainactivity">      <!-- parent activity meta-data support 4.0 , lower -->      <meta-data         android:name="android.support.parent_activity"         android:value="com.alex.myapp.mainactivity"/>   </activity> 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -