Sha256: 8ef748a3efd07c7bf36f66dd7b5b91f41892bb94a3a70992a2c8f44beb164693
Contents?: true
Size: 1005 Bytes
Versions: 37
Compression:
Stored size: 1005 Bytes
Contents
package sh.calaba.instrumentationbackend; import sh.calaba.instrumentationbackend.actions.preferences.PreferencesUtils; import android.content.SharedPreferences; import android.os.Bundle; import android.test.InstrumentationTestRunner; import android.util.Log; /** * Allows clearing SharedPreferences. * * See Ruby API docs for more info: * https://github.com/calabash/calabash-android/blob/master/documentation/ruby_api.md * * @author Juan Delgado (juan@ustwo.co.uk) */ public class ClearPreferences extends InstrumentationTestRunner { @Override public void onCreate(Bundle arguments) { SharedPreferences preferences = null; try{ preferences = PreferencesUtils.getPreferencesFromBundle(arguments, getTargetContext()); } catch(Exception e){ e.printStackTrace(); return; } preferences.edit().clear().commit(); String logcat = arguments.getString(PreferencesUtils.BUNDLE_LOGCAT_ID); Log.d(logcat, PreferencesUtils.resultToJson(Result.successResult())); } }
Version data entries
37 entries across 37 versions & 1 rubygems