Bundle getString - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Bundle getString method.

This code example shows how to use the following methods:getString
            Log.v("python service", "service exists, do not start again");
            return START_NOT_STICKY;
        } 
 
        Bundle extras = intent.getExtras();
        androidPrivate = extras.getString("androidPrivate");
        // service code is located in service subdir 
        androidArgument = extras.getString("androidArgument") + "/service";
        pythonHome = extras.getString("pythonHome");
        pythonPath = extras.getString("pythonPath");
        pythonServiceArgument = extras.getString("pythonServiceArgument");
        String serviceTitle = extras.getString("serviceTitle");
        String serviceDescription = extras.getString("serviceDescription");
 
        pythonThread = new Thread(this);
        pythonThread.start();
 
        Context context = getApplicationContext();
        Notification notification = new Notification(context.getApplicationInfo().icon,
                serviceTitle,
9
CodeRank
This code example shows how to use the following methods:getString
This code example shows how to use the following methods:getString
    private boolean mMultiFile = false;
 
    @Override 
    public void onCreate(Bundle arguments) {
        if (arguments != null) {
            mReportFile = arguments.getString(ARG_REPORT_FILE);
            mReportDir = arguments.getString(ARG_REPORT_DIR);
            mFilterTraces = getBooleanArgument(arguments, ARG_FILTER_TRACES, true);
            mMultiFile = getBooleanArgument(arguments, ARG_MULTI_FILE, false);
        } 
 
        if (mReportFile == null) {
            mReportFile = mMultiFile ? DEFAULT_MULTI_REPORT_FILE : DEFAULT_SINGLE_REPORT_FILE;
        } 
 
        super.onCreate(arguments);
    } 
 
    private boolean getBooleanArgument(Bundle arguments, String name, boolean defaultValue)
    { 

8
CodeRank
This code example shows how to use the following methods:getString
This code example shows how to use the following methods:getString
    private static final String DESCRIPTION = "description";
    private static final String VERSION = "version";
 
    private static String getPluginDescription(Bundle metaData) {
        // Find the name of the plugin's shared library. 
        String filename = metaData.getString(FILENAME);
        if (filename == null || filename.isEmpty()) {
            return null; 
        } 
        // Find the mimetype of the plugin. Flash is handled in getFlashPath. 
        String mimetype = metaData.getString(MIMETYPE);
        if (mimetype == null || mimetype.isEmpty()) {
            return null; 
        } 
        // Assemble the plugin info, according to the format described in 
        // pepper_plugin_registry.cc. 
        // (eg. path<#name><#description><#version>;mimetype) 
        StringBuffer plugin = new StringBuffer(PEPPER_PLUGIN_ROOT);
        plugin.append(filename);
 

7
CodeRank
This code example shows how to use the following methods:getInt, getString
        throwBundle(b);
        return b.getByteArray("out");
    } 
 
    private static void throwBundle(Bundle b) throws EeIOException {
        switch (b.getInt("e")) {
            case EE_ERROR_NFC_DISABLED:
                throw new EeNfcDisabledException(b.getString("m"));
            case EE_ERROR_IO:
                throw new EeIOException(b.getString("m"));
            case EE_ERROR_INIT:
                throw new EeInitializationException(b.getString("m"));
            case EE_ERROR_EXT_FIELD:
                throw new EeExternalFieldException(b.getString("m"));
            case EE_ERROR_LISTEN_MODE:
                throw new EeListenModeException(b.getString("m"));
            case EE_ERROR_ALREADY_OPEN:
                throw new EeAlreadyOpenException(b.getString("m"));
        } 
    } 

7
CodeRank
This code example shows how to use the following methods:get, getString
        return LayoutTestsAutoRunner.class.getClassLoader();
    } 
 
    @Override 
    public void onCreate(Bundle icicle) {
        this.mTestPath = (String) icicle.get("path");
        String timeout_str = (String) icicle.get("timeout");
        if (timeout_str != null) {
            try { 
                this.mTimeoutInMillis = Integer.parseInt(timeout_str);
            } catch (Exception e) {
                e.printStackTrace();
            } 
        } 
 
        String r = icicle.getString("rebaseline");
        this.mRebaseline = (r != null && r.toLowerCase().equals("true"));
 
        mJsEngine = icicle.getString("jsengine");
 

8
CodeRank
This code example shows how to use the following methods:getInt, getString
This code example shows how to use the following methods:getLong, getString
 
    @Override 
    public void onReceive(Context context, Intent intent) {
        Bundle extras = intent.getExtras();
        if (extras != null) {
            String accountKey = extras.getString("account_key");
            long postId = extras.getLong("post_id");
            String type = extras.getString("notification_type");
 
            Notifier.saveLastNotificationActioned(context, accountKey, type, postId);
 
        } 
    } 
} 
8
CodeRank
This code example shows how to use the following methods:containsKey, getString
                String authTokenType, String[] requiredFeatures, Bundle options)
                throws NetworkErrorException { 
            // There are two cases here: 
            // 1) We are called with a username/password; this comes from the traditional email 
            //    app UI; we simply create the account and return the proper bundle 
            if (options != null && options.containsKey(OPTIONS_PASSWORD)
                    && options.containsKey(OPTIONS_USERNAME)) {
                final Account account = new Account(options.getString(OPTIONS_USERNAME),
                        TEST_ACCOUNT_TYPE);
                AccountManager.get(EasTestAuthenticatorService.this).addAccountExplicitly(
                            account, options.getString(OPTIONS_PASSWORD), null);
 
                Bundle b = new Bundle();
                b.putString(AccountManager.KEY_ACCOUNT_NAME, TEST_ACCOUNT_TYPE);
                return b;
            // 2) The other case is that we're creating a new account from an Account manager 
            //    activity.  In this case, we add an intent that will be used to gather the 
            //    account information... 
            } else { 
                Bundle b = new Bundle();
8
CodeRank

Related Bundle getString Questions & Answers:

Other Bundle getString Examples

47:	    protected void onMessage(Context context, Intent intent) {
48:	        Log.i(TAG, "Received message");
49:	        String message = intent.getExtras().getString("price");
50:	        
51:	        displayMessage(context, message);

Read More

getString Method Overview
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.
See Code Examples for other Android Bundle Methods: