---
title: "android --View 刷新焦点问题"
author: "carywei"
date: "2011-09-19T16:28:48Z"
tags: []
categories: ["移动开发"]
slug: "android-view"
draft: false
lastmod: "2011-09-19T16:28:48Z"
id: 1175222
url: "https://carywei.iteye.com/blog/1175222"
---

如果一个activity中，多次调用setContentView方法，可能会导致view失去焦点。

目前知道一种解决方式:

     首先：清掉刷新前的View的焦点 --------view.clearFocus();

     然后：将刷新的view请求焦点   ---------view.requestFocus();

View中还有几种添加焦点的方式。可以查看view.java了解