package org.ligi.androidhelper.helpers;

import android.content.Context;
import android.content.Intent;

public class ContextHelper {

    private final Context context;

    public ContextHelper(Context context) {
        this.context =context;
    }

    public void startActivityForClass(Class class2start) {
        Intent intent = new Intent(context, class2start);
        context.startActivity(intent);
    }
}

@@ -96,16 +96,88 @@
 .Intent;
+%0Aimport android.view.ViewConfiguration;%0A%0Aimport java.lang.reflect.Field;
 %0A%0Apublic
@@ -302,16 +302,17 @@
 ontext =
+ 
 context;
@@ -432,24 +432,24 @@
 ass2start);%0A
-
         cont
@@ -480,11 +480,847 @@
 );%0A    %7D
+%0A%0A    /**%0A    * a little hack because I strongly disagree with the style guide here%0A    * ;-)%0A    * not having the Actionbar overfow menu also with devices with hardware%0A    * key really helps discoverability%0A    * http://stackoverflow.com/questions/9286822/how-to-force-use-of-overflow-menu-on-devices-with-menu-button%0A    **/%0A    public void forceOverFlowMenuEvenThoughDeviceHasPhysical() %7B%0A%0A        try %7B%0A            ViewConfiguration config = ViewConfiguration.get(context);%0A            Field menuKeyField = ViewConfiguration.class.getDeclaredField(%22sHasPermanentMenuKey%22);%0A            if (menuKeyField != null) %7B%0A                menuKeyField.setAccessible(true);%0A                menuKeyField.setBoolean(config, false);%0A            %7D%0A        %7D catch (Exception ex) %7B%0A            // Ignore - but at least we tried ;-)%0A        %7D%0A    %7D
 %0A%7D%0A

add a nice method to force overflow menu icon even though the device has a physical one