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

Version Path
calabash-android-0.4.20.1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.5.2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.5.2.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.5.1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.5.0 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.5.0.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.5.0.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.4.22.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.4.22.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.4.22.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.4.21 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.4.20 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.4.19 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.4.19.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.4.19.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.4.19.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.4.19.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.4.18 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.4.16 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java
calabash-android-0.4.15.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/ClearPreferences.java