activity跳转后第二个activity,actionbar显示不全

a156435646 2014-12-30 05:32:28
我是第一个activity跳转到第二个activity(继承 ActionBarActivity )时候,在oncreate方法中
有 protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
actionBar=getSupportActionBar();
setContentView(R.layout.security_home);
Boolean isUpdate=getIntent().getBooleanExtra("isUpdate", false);
Toast.makeText(getApplicationContext(), "拿到check的值了: "+isUpdate.toString(),
Toast.LENGTH_LONG).show();
UpdateManagerUtil um= new UpdateManagerUtil(HomeActivity.this);
um.showDownloadDialog();
}


其中showDownloadDialog方法
public void showDownloadDialog()
{
// 构造软件下载对话框
AlertDialog.Builder builder = new Builder(mContext);
builder.setTitle("Test");
// 给下载对话框增加进度条
final LayoutInflater inflater = LayoutInflater.from(mContext);
View v = inflater.inflate(R.layout.update_dialog_progress, null);
mProgress = (ProgressBar) v.findViewById(R.id.update_progress);
//textView = (TextView)v.findViewById(R.id.textView01);
builder.setView(v);
// 取消更新
builder.setNegativeButton("Testquxiao", new OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
dialog.dismiss();
// 设置取消状态
cancelUpdate = true;
}
});
mDownloadDialog = builder.create();
mDownloadDialog.setCancelable(false);
mDownloadDialog.show();
// 现在文件
downloadApk();
}
然后出现奇怪的问题是
actionbar出现被遮挡,
如果是直接启动这个activity
直接启动就没有问题

然后我还发现如果
<ProgressBar
android:id="@+id/update_progress"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleHorizontal" />
把进度条的style="?android:attr/progressBarStyleHorizontal"这句去掉或者换成其他style,actionbar不会被遮挡,求各路支招
...全文
366 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
a156435646 2014-12-30
  • 打赏
  • 举报
回复
然后我还发现如果 <ProgressBar android:id="@+id/update_progress" android:layout_width="fill_parent" android:layout_height="wrap_content" style="?android:attr/progressBarStyleHorizontal" /> 把进度条的style="?android:attr/progressBarStyleHorizontal"这句去掉或者换成其他style,actionbar不会被遮挡,求各路支招
passself 2014-12-30
  • 打赏
  • 举报
回复
应该是因为progress弹出了就相当于一层,最下面的就出问题了,不弹出progress 弹出dialog应该也会是一样的效果

80,472

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧