Since you're getting your error in this procedure, the simplest way to get rid of it would be to change it like this
//@Override
public void onBackPressed()
{
LocalActivityManager localManager = getLocalActivityManager();
Activity currentActivity = null;
if (localManager!=null){
currentActivity = localManager.getCurrentActivity();
}
String activityName = null;
if (currentActivity!=null){
activityName = currentActivity.toString()
}
if(activityName!=null && (activityName.contains("ShowProgress"))
{
getCurrentActivity().onBackPressed();
}
else
{
Toast.makeText(getApplicationContext(), "Back button from parent Activity", Toast.LENGTH_SHORT).show();
//finish();
}
}