Note that there are some explanatory texts on larger screens.

plurals
  1. POStarting activity with a new flag
    primarykey
    data
    text
    <p>How can I start activity with a new flag? I have 2 activities. One is main and other one I used for displaying database in <code>ListView</code>. It consists of address and (latitude,longitude) values. I'm trying that whenever I click an item control should go to the main activity and show that (latitude,longitude) values there on map. I passed the (latitude,longitude) values in a bundle and wrote a <code>set()</code> in main activity to set the (lat,lon) values. But the main activity is running in background. My code in the 2nd activity is:</p> <pre><code> Intent i1=new Intent(Display.this,Cortes.class); Bundle b11=new Bundle(); b11.putDouble(q, b1); b11.putDouble(r, c1); //b11.putBoolean("flag", flag); i1.putExtras(b11); i1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(i1); </code></pre> <p>Here b1,c1 are (latitude,longitude) values and <code>Cortes</code> is main activity and <code>Display</code> is 2nd activity. My code in main activity is:</p> <pre><code>public void set() { bun=getIntent().getExtras(); q=bun.getDouble("q"); r=bun.getDouble("r"); GeoPoint new1=new GeoPoint((int)(q*1000000), (int)(r*10000000)); mc.setCenter(new1); mapOverlays = mv.getOverlays(); OverlayItem overlayitem = new OverlayItem(new1, "New", "test1"); itemizedOverlay.addOverlay(overlayitem); mapOverlays.add(itemizedOverlay); mc.animateTo(new1); mv.setSatellite(false); mc.setCenter(new1); mv.postInvalidate(); } </code></pre> <p>Is there any way to call <code>set()</code> from 2nd activity? Or how should I call it when the main activity is called from 2nd activity? Also I want to start main activity with a new flag.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload