Android Open Source - CompleteActionPlus Test Intent Activity






From Project

Back to project page CompleteActionPlus.

License

The source code is released under:

## Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License ## By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and condi...

If you think the Android project CompleteActionPlus listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package hk.valenta.completeactionplus;
//  w ww .j  a  v  a  2s.  c o m
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.TextView;

public class TestIntentActivity extends Activity {

  private Intent myIntent;
  
  @SuppressWarnings("deprecation")
  @SuppressLint("WorldReadableFiles")
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // get current configuration
    SharedPreferences pref = this.getSharedPreferences("config", Context.MODE_WORLD_READABLE);
    String theme = pref.getString("AppTheme", "Light");
    if (theme.equals("Dark")) {
      setTheme(android.R.style.Theme_Holo_NoActionBar);
    } else {
      setTheme(android.R.style.Theme_Holo_Light_NoActionBar);
    }
    
    // super
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_test_intent);

    // get intent
    myIntent = getIntent();
    final String action = myIntent.getAction();
    final String type = myIntent.getType();
    final String scheme = myIntent.getScheme();
    
    // display info
    TextView tvAction = (TextView)findViewById(R.id.test_intent_action_value);
    if (action == null) {
      tvAction.setText(getString(R.string.manage_list_not_available));
    } else {
      tvAction.setText(action.substring(action.lastIndexOf(".") + 1));
    }
    TextView tvType = (TextView)findViewById(R.id.test_intent_type_value);
    if (type == null) {
      tvType.setText(getString(R.string.manage_list_not_available));
    } else {
      tvType.setText(type);
    }
    TextView tvScheme = (TextView)findViewById(R.id.test_intent_scheme_value);
    if (scheme == null) {
      tvScheme.setText(getString(R.string.manage_list_not_available));
    } else {
      tvScheme.setText(scheme);
    }    
  }  
}




Java Source Code List

hk.valenta.completeactionplus.AboutFragment.java
hk.valenta.completeactionplus.AddedFragment.java
hk.valenta.completeactionplus.AdvancedFragment.java
hk.valenta.completeactionplus.ColorPicker.java
hk.valenta.completeactionplus.DialogFragment.java
hk.valenta.completeactionplus.EnumConvert.java
hk.valenta.completeactionplus.FavoriteFragment.java
hk.valenta.completeactionplus.HiddenFragment.java
hk.valenta.completeactionplus.IntentRecorderActivity.java
hk.valenta.completeactionplus.IntentRecorderReceiver.java
hk.valenta.completeactionplus.LayoutFragment.java
hk.valenta.completeactionplus.MainPagerActivity.java
hk.valenta.completeactionplus.ManageListActivity.java
hk.valenta.completeactionplus.ManagerPagerActivity.java
hk.valenta.completeactionplus.RuleItemHelper.java
hk.valenta.completeactionplus.SelectListActivity.java
hk.valenta.completeactionplus.StartSelectedReceiver.java
hk.valenta.completeactionplus.TemporaryDefaultReceiver.java
hk.valenta.completeactionplus.TestIntentActivity.java
hk.valenta.completeactionplus.XCompleteActionPlus.java