正在查看: 爱心e站 v1.0.0 应用的 WNaviGuideActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 爱心e站 v1.0.0 应用的 WNaviGuideActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.example.baidumap;
import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import com.baidu.mapapi.walknavi.WalkNavigateHelper;
import com.baidu.mapapi.walknavi.adapter.IWNaviStatusListener;
import com.baidu.mapapi.walknavi.adapter.IWRouteGuidanceListener;
import com.baidu.mapapi.walknavi.adapter.IWTTSPlayer;
import com.baidu.mapapi.walknavi.model.RouteGuideKind;
import com.baidu.platform.comapi.walknavi.WalkNaviModeSwitchListener;
public class WNaviGuideActivity extends Activity {
private static final String TAG = WNaviGuideActivity.class.getSimpleName();
private WalkNavigateHelper mNaviHelper;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.mNaviHelper = WalkNavigateHelper.getInstance();
this.mNaviHelper.setTTsPlayer(new IWTTSPlayer() {
@Override
public int playTTSText(String s, boolean b) {
return 0;
}
});
try {
View view = this.mNaviHelper.onCreate(this);
if (view != null) {
setContentView(view);
}
} catch (Exception e) {
e.printStackTrace();
}
this.mNaviHelper.setWalkNaviStatusListener(new IWNaviStatusListener() {
@Override
public void onWalkNaviModeChange(int mode, WalkNaviModeSwitchListener listener) {
Log.d(WNaviGuideActivity.TAG, "onWalkNaviModeChange : " + mode);
WNaviGuideActivity.this.mNaviHelper.switchWalkNaviMode(WNaviGuideActivity.this, mode, listener);
}
@Override
public void onNaviExit() {
Log.d(WNaviGuideActivity.TAG, "onNaviExit");
}
});
boolean startResult = this.mNaviHelper.startWalkNavi(this);
Log.e(TAG, "startWalkNavi result : " + startResult);
this.mNaviHelper.setTTsPlayer(new IWTTSPlayer() {
@Override
public int playTTSText(String s, boolean b) {
Log.d("tts", s);
return 0;
}
});
this.mNaviHelper.setRouteGuidanceListener(this, new IWRouteGuidanceListener() {
@Override
public void onRouteGuideIconUpdate(Drawable icon) {
}
@Override
public void onRouteGuideKind(RouteGuideKind routeGuideKind) {
}
@Override
public void onRoadGuideTextUpdate(CharSequence charSequence, CharSequence charSequence1) {
}
@Override
public void onRemainDistanceUpdate(CharSequence charSequence) {
}
@Override
public void onRemainTimeUpdate(CharSequence charSequence) {
}
@Override
public void onGpsStatusChange(CharSequence charSequence, Drawable drawable) {
}
@Override
public void onRouteFarAway(CharSequence charSequence, Drawable drawable) {
}
@Override
public void onRoutePlanYawing(CharSequence charSequence, Drawable drawable) {
}
@Override
public void onReRouteComplete() {
}
@Override
public void onArriveDest() {
}
@Override
public void onVibrate() {
}
});
}
@Override
protected void onDestroy() {
super.onDestroy();
this.mNaviHelper.quit();
}
@Override
protected void onResume() {
super.onResume();
this.mNaviHelper.resume();
}
@Override
protected void onPause() {
super.onPause();
this.mNaviHelper.pause();
}
}