I know this type of questions have come before, and I have went threw them, but didn't get the final part which I need to do.
My ExceptionClass
public class ProException extends Exception {
/**
*
*/
private static final long serialVersionUID = 1L;
public ProException(String message) {
super(message);
}
}
My ActivityClass (Custom Adapter in Android for 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;
}
Now what I want is.
If there is an Exception which occurs in this try catch any Exception.
It should be captured by my custom class (ProException). But its not allowing.
Any help
Message in Java Eclipse Editor
Unreachable catch block for ProException. This exception is never thrown from the try statement body
ProExceptionin order to catch it...