提交 b2f1f4a1 编写于 作者: T Takeya Yuki

Fix

上级 7cc8cf6c
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "jp.ruby.rubylibrary"
minSdkVersion 21
......
package jp.ruby.rubylibrary;
import android.app.Activity;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
......@@ -19,11 +21,13 @@ import java.nio.charset.Charset;
import java.util.Locale;
import yuki.control.extended.WebViewEx;
import yuki.msg.extended.NotificationController;
import yuki.resource.extended.GsonConvert;
import yuki.resource.extended.StorageIOManager;
import yuki.resource.extended.UIController;
import yuki.tts.extended.TTSComplexController;
public class MainActivity extends Activity {
@Override
......@@ -36,6 +40,14 @@ public class MainActivity extends Activity {
wv.loadUrl("http://10.1.1.134:8282/Client.html");
wv.addJavascriptInterface(new TTSComplexController(getApplicationContext(), Locale.SIMPLIFIED_CHINESE), "tts");
//wv.addJavascriptInterface(new JS(getApplicationContext()), "tts");
Intent i=new Intent(Intent.ACTION_VIEW,Uri.parse("http://www.baidu.com/"));
PendingIntent pi=PendingIntent.getActivity(getApplicationContext(),0,i,PendingIntent.FLAG_UPDATE_CURRENT);
Intent srv=new Intent("AAA");
srv.setPackage(getPackageName());
startService(srv);
NotificationController.Notify(getApplicationContext(),1,R.mipmap.ic_launcher,pi,"Ticker","Title","Content",Notification.FLAG_NO_CLEAR|Notification.FLAG_AUTO_CANCEL);
NotificationController.Notify(getApplicationContext(),1,R.mipmap.ic_launcher,pi,"Ticker2","Title2","Content2",Notification.FLAG_NO_CLEAR|Notification.FLAG_AUTO_CANCEL);
}
}
......
package jp.ruby.rubylibrary;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.Intent;
import android.net.Uri;
import android.os.MemoryFile;
import java.io.IOException;
import yuki.msg.extended.NotificationController;
import yuki.msg.extended.YukiPushService;
/**
* Created by Akeno on 2017/08/28.
*/
public class TestService {
public class TestService extends YukiPushService {
@Override
public String GetRemoteEndPoint() {
return "10.1.1.134:10086";
}
@Override
public int GetIcon(){
return R.mipmap.ic_launcher;
}
@Override
public int GetServiceID(){
return 10;
}
@Override
public void onCreate(){
super.onCreate();
}
@Override
public void MessagePushed(String msg) {
Intent j=new Intent(Intent.ACTION_VIEW, Uri.parse(msg));
j.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(j);
}
}
......@@ -15,7 +15,7 @@ publish {
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
buildToolsVersion "26.0.1"
defaultConfig {
minSdkVersion 21
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册