Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.myPhonegapProj;
- import android.annotation.SuppressLint;
- import android.content.ComponentName;
- import android.content.Context;
- import android.content.Intent;
- import android.content.ServiceConnection;
- import android.media.MediaPlayer;
- import android.os.Bundle;
- import android.os.Handler;
- import android.os.IBinder;
- import android.os.SystemClock;
- import android.R;
- import android.webkit.JavascriptInterface;
- import org.apache.cordova.*;
- public class MainActivity extends CordovaActivity {
- @JavascriptInterface
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- // enable Cordova apps to be started in the background
- Bundle extras = getIntent().getExtras();
- if (extras != null && extras.getBoolean("cdvStartInBackground", false)) {
- moveTaskToBack(true);
- }
- appView.addJavascriptInterface(this, "MainActivity");
- // Set by <content src="index.html" /> in config.xml
- loadUrl(launchUrl);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement