我怎么才能知道键盘是否打开.实际上我的问题是,如果键盘打开,那么我只是要求隐藏,而不是总是调用hide.有什么方法可以检查键盘是否打开?目前我正在使用这种方法来隐藏键盘.
EditText myEditText = (EditText) findViewById(R.id.myEditText);
View view = this.getCurrentFocus();
if (view != null) {ditText) findViewById(R.id.myEditText);
View view = this.getCurrentFocus();
if (view != null) { Inp`
im.hideSoftInputFromWindow(view.getWindowToken(), 0);
Run Code Online (Sandbox Code Playgroud) 我正在开发一个项目,在这个项目中,根据用户手指手势需要缩放和旋转图像视图,就像在一些iPhone应用程序中工作一样.请告诉我如何在android中进行操作."
我正在通话结束后阅读通话记录,根据此情况,如果呼叫已连接,则呼叫持续时间大于0.如果持续时间大于0,我会在2天后安排对该号码的下一次呼叫.如果通话时长为0,那么我会在1天后安排对该号码的下一次通话.
我的问题是,当呼叫连接然后它正确安排,但当呼叫未连接时,则显示前一个文本.有时它是正确的,有时是不正确的.
我从接收器打开这个活动.请提供更好的解决方案
以下是我的代码:
@Override
protected void onResume() {
/**
* this values only set when call maked from app then it w
* ill set auto filled some of filled in follow up
*
*/
if(flag!=null && flag.equalsIgnoreCase("Followup")/*&& state!=true*/){
if(SharedPrefs.getBoolean(this, SharedPrefs.PREFS_AUTH, SharedPrefs.
KEY_SCHEDULE_NEXT_FOLLOWUP, false))
{
findViewById(R.id.rl_followUp).setVisibility(View.VISIBLE);
} else {
findViewById(R.id.rl_followUp).setVisibility(View.GONE);
}
getCallDetails();
/*
String strDateFormat = "hh:mm a";
SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
calendar=Calendar.getInstance();
*/
if(callDuration > 0){
tvDateText.setText(timeInMilies(2));
etFUComments.setText("Call is done");
} else {
tvDateText.setText(timeInMilies(1));
etFUComments.setText(getResources().
getString(R.string.call_not_connected_detail));
} …Run Code Online (Sandbox Code Playgroud) android ×3