Run the Challenge 11 service and display it on the screen (page 362)Run the Challenge 11 service and display it on the screen (page 362)Previous Image Next ImageWhen you press the button, input box, or textview button, input box→service→text view mainactivity→MainActivity.javaWhen you press the button, input box, or textview button, input box→service→text view mainactivity→MainActivity.javaMain Activity – activity_main.xml<?xml version=”1.0″ encoding=”utf-8″?><LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android “xmlns:app=”http://schemas.android.com/apk/res-auto “xmlns:tools=”http://schemas.android.com/tools “android:layout_width=”match_parent”android:layout_height= “match_parent”android:orientation=”vertical”tools:context=”.MainActivity”><EditTextAndroid:layout_wid=@+id/394dplay_hotalloyndromedoid>ginmarServices – My Service.xmlServices – My Service.xmlImport the package ctml.o.o.op 11.25.Import the Android.client.intention; import the Android.os.IBinder; public class MyService is service {sublic MyService() {} {} @Override public int onStartCommand(intent, int flags, int startId) {if(interface!
=null) — Expand { string message= entry.g.etStringExtrigger (“}}}): Intent main_context = new Intent(getApplicationContext(), MainActivity.class); main_intent.putExtra(“メッセージ”, メッセージ); main_intent.addFlags(意図。FLAG_ACTIVITY_NEW_TASK|意図。フラグ_ACTIVITY_SINGLE_TOP|意図。FLAG_ACTIVITY_CLEAR_TOP);startActivity(main_intent);}stopSelf();super.onStartCommand(intent, flags, startId);} @Override public IBinder on Bind(intent) {// TODO:通信チャネルをサービスに戻します.Exclusive new operation (not implementation”)Import package com.html.doit11;android.app .Import services;android.content.Intent;import Android.os.IBinder;Public class MyService is a service {publicMyService()} {} {} @Override public int onStartCommand(intent, int flags, int startId) {if(interface!
= null) {extends string message=intent.getStringExtra(“message”)}; Intent main_context = new Intent(getApplicationContext(), MainActivity.class); main_intent.putExtra(“メッセージ”, メッセージ); main_intent.addFlags(意図。FLAG_ACTIVITY_NEW_TASK|意図。フラグ_ACTIVITY_SINGLE_TOP|意図。FLAG_ACTIVITY_CLEAR_TOP);startActivity(main_intent);}stopSelf();super.onStartCommand(intent, flags, startId);} @Override public IBinder on Bind(intent) {// TODO:通信チャネルをサービスに戻します.Exception(“Not Implemented”);} to throw new unsupported operationImport package com.html.doit11;android.app .Import services;android.content.Intent;import Android.os.IBinder;Public class MyService is a service {publicMyService()} {} {} @Override public int onStartCommand(intent, int flags, int startId) {if(interface!
= null) {extends string message=intent.getStringExtra(“message”)}; Intent main_context = new Intent(getApplicationContext(), MainActivity.class); main_intent.putExtra(“メッセージ”, メッセージ); main_intent.addFlags(意図。FLAG_ACTIVITY_NEW_TASK|意図。フラグ_ACTIVITY_SINGLE_TOP|意図。FLAG_ACTIVITY_CLEAR_TOP);startActivity(main_intent);}stopSelf();super.onStartCommand(intent, flags, startId);} @Override public IBinder on Bind(intent) {// TODO:通信チャネルをサービスに戻します.Exception(“Not Implemented”);} to throw new unsupported operation