我有一个带有5个标签的标签活动。每个选项卡都有多个活动。当我导航回前一个活动的finishFromChild(Activity child)函数调用时,我使用了Intent标志Intent.FLAG_ACTIVITY_SINGLE_TOP。
回到上一个活动之后创建我的问题,因为我之前的活动是自动完成文本视图后的地图活动,后自动填充文本视图变得不可编辑,并且在此自动填充文本视图中单击后键盘未显示,直到我长按后选择其文本。
请先帮助我
**here is my code for finishFromChild(Activity child)**
@Override
public void finishFromChild(Activity child) {
LocalActivityManager manager = getLocalActivityManager();
int index = mIdList.size()-1;
Log.d("in finish from child<>>>>>>>>>>>>>", ""+index+"");
if (index < 1) {
finish();
return;
}
manager.destroyActivity(mIdList.get(index), true);
mIdList.remove(index); index--;
String lastId = mIdList.get(index);
Intent lastIntent = manager.getActivity(lastId).getIntent();
Window newWindow = manager.startActivity(lastId, lastIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP));
setContentView(newWindow.getDecorView());
}
**and Here is my Code for AutocompleteTextView**
try {
TenLifeDataSource dataSource = new TenLifeDataSource(this);
mSearchedCitymList = dataSource.getAllCityBySearchString();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
findViewById(R.id.headerLogoImageView).setOnClickListener(
new InfoButtonListener(this));
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_dropdown_item_1line, mSearchedCitymList);
Log.d("check it", "i m in editor");
mSearchAutoCompleteText = (AutoCompleteTextView) findViewById(R.id.searchBox);
mSearchAutoCompleteText.setImeOptions(EditorInfo.IME_ACTION_DONE);
// mSearchEditText.setOnEditorActionListener(mEditorActionListener);
mSearchAutoCompleteText
.setOnEditorActionListener(mEditorActionListener);
mSearchAutoCompleteText.setAdapter(adapter);
mSearchAutoCompleteText
.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
InputMethodManager inputManager = (InputMethodManager) getApplicationContext()
.getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.toggleSoftInput(0, 0);
mSearchAutoCompleteText.dismissDropDown();
/*
* if (!TextUtils.isEmpty(v.getText())) {
* mLastSearchedString = v.getText().toString();
* showSearchResults(); //return true; }
*/
mLastSearchedString = mSearchAutoCompleteText.getText()
.toString();
// //Log.d("test adderess here", mLastSearchedString);
// mLastSearchedString = v.getText().toString();
if (mLastSearchedString.length() > 0) {
// Log.d("center",
// ""+mLastSearchedString.length()+"");
getlocationinfo(mLastSearchedString);
}
// if(menuItems.size() <= 0)
// showSearchResults(mLastSearchedType);
// updateSuppliers(mLastSearchedType);
// showSearchResults();
}
});