Search Results

Search found 4 results on 1 pages for 'mrmamon'.

Page 1/1 | 1 

  • Android always play intro clip

    - by mrmamon
    I'm trying to make my app to play intro clip for only when I start activities. But from my code it's always play the clip after wakeup before resume to app although I did not closed the app. What can I do to fix this prob? Thanks From main: startActivity(new Intent(this, MyIntro.class)); From MyIntro: public class MyIntro extends Activity implements OnCompletionListener { int a; @Override protected void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.intro); playIntro(); } public void onConfigurationChanged(Configuration newConfig) { setContentView(R.layout.intro); } public void onCompletion(MediaPlayer arg0) { // TODO Auto-generated method stub this.finish(); } private void playIntro(){ setContentView(R.layout.intro); VideoView video = (VideoView) this.findViewById(R.id.VideoView01); Uri uri = Uri.parse("android.resource://real.app/" + R.raw.intro); video.setVideoURI(uri); video.requestFocus(); video.setOnCompletionListener(this); video.start(); } }

    Read the article

  • GPS not update location after close and reopen app on android

    - by mrmamon
    After I closed my app for a while then reopen it again,my app will not update location or sometime it will take long time( about 5min) before update. How can I fix it? This is my code private LocationManager lm; private LocationListener locationListener; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locationListener = new mLocationListener(); lm.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, locationListener); } private class myLocationListener implements LocationListener { @Override public void onLocationChanged(Location loc) { if (loc != null) { TextView gpsloc = (TextView) findViewById(R.id.widget28); gpsloc.setText("Lat:"+loc.getLatitude()+" Lng:"+ loc.getLongitude()); } } @Override public void onProviderDisabled(String provider) { // TODO Auto-generated method stub TextView gpsloc = (TextView) findViewById(R.id.widget28); gpsloc.setText("GPS OFFLINE."); } @Override public void onProviderEnabled(String provider) { // TODO Auto-generated method stub } @Override public void onStatusChanged(String provider, int status, Bundle extras) { // TODO Auto-generated method stub } }

    Read the article

1