Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. package com.example.myPhonegapProj;
  2. import android.annotation.SuppressLint;
  3. import android.content.ComponentName;
  4. import android.content.Context;
  5. import android.content.Intent;
  6. import android.content.ServiceConnection;
  7. import android.media.MediaPlayer;
  8. import android.os.Bundle;
  9. import android.os.Handler;
  10. import android.os.IBinder;
  11. import android.os.SystemClock;
  12. import android.R;
  13. import android.webkit.JavascriptInterface;
  14. import org.apache.cordova.*;
  15.  
  16.  
  17. public class MainActivity extends CordovaActivity {
  18.  
  19. @JavascriptInterface
  20. public void onCreate(Bundle savedInstanceState) {
  21.  
  22. super.onCreate(savedInstanceState);
  23. // enable Cordova apps to be started in the background
  24. Bundle extras = getIntent().getExtras();
  25. if (extras != null && extras.getBoolean("cdvStartInBackground", false)) {
  26. moveTaskToBack(true);
  27. }
  28.  
  29. appView.addJavascriptInterface(this, "MainActivity");
  30.  
  31. // Set by <content src="index.html" /> in config.xml
  32. loadUrl(launchUrl);
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement