この種の質問が以前にもあったことは知っており、それらを投げに行ったことがありますが、必要な最後の部分を取得できませんでした。
私の例外クラス
public class ProException extends Exception {
/**
*
*/
private static final long serialVersionUID = 1L;
public ProException(String message) {
super(message);
}
}
My 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