我有两个活动,在activityA
我有一个图标,点击该图标我发送意图到其他activityB
,即调用facebook页面(自定义dailog),因为{{ 1}}需要时间来加载我正在尝试实现fbdailog
,下面是我的代码
progressdailog
问题是在发布或取消ImageView faceBookIntegration = (ImageView) activity
.findViewById(R.id.facebookintegration);
faceBookIntegration.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
Constants.isLayoutTouched = true;
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN: {
CityAttractions.this.runOnUiThread(new Runnable() {
public void run() {
dialog = ProgressDialog.show(CityAttractions.this, "","Please wait...", true);
dialog.show();
}
});
Intent menuSettingsIntent = new Intent(CityAttractions.this, ShareOnFacebook.class);
menuSettingsIntent.putExtra("facebookMessage", "Msg");
startActivityForResult(new Intent(menuSettingsIntent).addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT), 1);
break;
}
case MotionEvent.ACTION_MOVE:
break;
case MotionEvent.ACTION_UP:
break;
}
return false;
}
});
}
后,fbdailog
仍然可见,我如何从progressdailog
中解除progreessdailog
。任何帮助表示赞赏
答案 0 :(得分:0)
在ActivityA的onActivityResult()
中执行:
if (dialog != null) {
dialog.dismiss();
}