|
|
|
@ -3,6 +3,7 @@ package com.unionmed.unionmedtv.activity; |
|
|
|
|
import android.content.Context; |
|
|
|
|
import android.content.Intent; |
|
|
|
|
import android.os.Bundle; |
|
|
|
|
import android.view.KeyEvent; |
|
|
|
|
import android.view.View; |
|
|
|
|
import android.widget.ImageView; |
|
|
|
|
import android.widget.TextView; |
|
|
|
@ -13,6 +14,7 @@ import androidx.lifecycle.Observer; |
|
|
|
|
import androidx.viewpager2.adapter.FragmentStateAdapter; |
|
|
|
|
import androidx.viewpager2.widget.ViewPager2; |
|
|
|
|
|
|
|
|
|
import com.blankj.utilcode.util.ToastUtils; |
|
|
|
|
import com.bumptech.glide.Glide; |
|
|
|
|
import com.bumptech.glide.request.RequestOptions; |
|
|
|
|
import com.lxj.xpopup.XPopup; |
|
|
|
@ -131,4 +133,21 @@ public class HomeActivity extends BaseActivity implements View.OnFocusChangeList |
|
|
|
|
AddressSelectActivity.StartActivity(HomeActivity.this); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private long exitTime = 0; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean onKeyDown(int keyCode, KeyEvent event) { |
|
|
|
|
if (keyCode == KeyEvent.KEYCODE_BACK) { |
|
|
|
|
if (System.currentTimeMillis() - exitTime > 2000) { |
|
|
|
|
ToastUtils.showLong("在按一次退出程序"); |
|
|
|
|
exitTime=System.currentTimeMillis(); |
|
|
|
|
} else { |
|
|
|
|
finish(); |
|
|
|
|
System.exit(0); |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
return super.onKeyDown(keyCode, event); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|