添加查看车辆位置功能

This commit is contained in:
2024-08-22 09:25:04 +08:00
parent 367caff796
commit b0a1b04422
21 changed files with 637 additions and 6 deletions
@@ -4,11 +4,14 @@ import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;
@@ -39,6 +42,28 @@ public abstract class BaseActivity extends AppCompatActivity {
protected Toolbar mToolbar;
protected int mRefreshPage = 1;
protected int mRefreshCount = 15;
public Handler hd=new Handler(msg -> {
msgMethod(msg);
return false;
});
public void msgMethod(Message m){
switch (m.what){
case -1:
Toast.makeText(mContext,"请求失败,请检查网络状况",Toast.LENGTH_SHORT).show();
break;
case 404:
Toast.makeText(mContext,"请求地址未找到",Toast.LENGTH_SHORT).show();
break;
case 500:
Toast.makeText(mContext,"服务器出现异常",Toast.LENGTH_SHORT).show();
break;
case 502:
Toast.makeText(mContext,"网关错误",Toast.LENGTH_SHORT).show();
break;
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);