forked from lubuwest/Friendiqa
v.0.4
This commit is contained in:
parent
aca94a5393
commit
63dfb9b197
70 changed files with 2829 additions and 1056 deletions
40
source-android/android/src/FriendiqaStopService.java
Normal file
40
source-android/android/src/FriendiqaStopService.java
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
package androidnative.friendiqa;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
import android.app.job.JobService;
|
||||
import android.app.job.JobParameters;
|
||||
import androidnative.AndroidNativeService;
|
||||
import org.qtproject.qt5.android.bindings.QtService;
|
||||
import org.qtproject.qt5.android.QtNative;
|
||||
//import androidnative.friendiqa.FriendiqaQtService;
|
||||
|
||||
public class FriendiqaStopService extends JobService{
|
||||
private static String TAG = "AndroidNative";
|
||||
//Log.e(TAG,"Service");
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onStartJob(JobParameters params) {
|
||||
//Log.d(TAG,"Friendiqa JobServiceStop");
|
||||
Context context = this.getApplicationContext();
|
||||
AndroidNativeService fs = new AndroidNativeService();
|
||||
fs.stopQtService(context);
|
||||
jobFinished(params,false);
|
||||
//Intent serviceIntent = new Intent(this, AndroidNativeService.class);
|
||||
//startService(serviceIntent);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onStopJob(JobParameters params) {
|
||||
// whether or not you would like JobScheduler to automatically retry your failed job.
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onUnbind(Intent intent) {
|
||||
stopSelf();
|
||||
return super.onUnbind(intent);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue