我知道这种类型的问题以前有过,我已经把它们扔了,但没有得到我需要做的最后一部分。
我的异常类
public class ProException extends Exception {
/**
*
*/
private static final long serialVersionUID = 1L;
public ProException(String message) {
super(message);
}
}
我的 ActivityClass(Android 中用于 ListView 的自定义适配器)
public View getView(int position, View convertView, ViewGroup parent) {
View vi = convertView;
try {
if (convertView == null) {
vi = inflater.inflate(R.layout.pause_client_trigger_request_select_sku_list_row, null);
tvItemName = (TextView) vi.findViewById(R.id.list_row_ItemName);
} else {
tvItemName = (TextView) vi.findViewById(R.id.list_row_ItemName);
}
hmap = new HashMap<String, String>();
hmap = data.get(position);
tvItemName.setText(hmap.get(KEY_ItemName));
} catch (ProException ex) {
Log.i(Tag, ex.getMessage());
}
return vi;
}
现在我想要的是。
try catch
如果在此任何异常中发生异常。它应该被我的custom class (ProException)
. 但它不允许。任何帮助
Java Eclipse 编辑器中的消息
Unreachable catch block for ProException. This exception is never thrown from the try statement body