Example usage for android.app Activity getIntent

List of usage examples for android.app Activity getIntent

Introduction

In this page you can find the example usage for android.app Activity getIntent.

Prototype

public Intent getIntent() 

Source Link

Document

Return the intent that started this activity.

Usage

From source file:com.it.xushuai.baseapp.fragment.BaseFragment.java

/**
 * Get serializable extra from activity's intent
 *
 * @param name//from   ww  w  . ja  v a 2 s. c  om
 * @return extra
 */
@SuppressWarnings("unchecked")
protected <V extends Serializable> V getSerializableExtra(final String name) {
    Activity activity = getActivity();
    if (activity != null)
        return (V) activity.getIntent().getSerializableExtra(name);
    else
        return null;
}

From source file:edu.stanford.mobisocial.dungbeetle.ui.fragments.FeedHistoryFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    mFeedUri = activity.getIntent().getData();
}

From source file:com.ui.UiActivity.java

public void startActivity(Context context, Class<?> zls, final Map<String, String> intentParameter) {

    Activity activity = ((Activity) context);
    Intent intent = (Intent) activity.getIntent();
    intent.setClass(context, zls);//from  w ww.  j a  va  2  s .co m
    if (null != intentParameter) {
        for (Map.Entry<String, String> entry : intentParameter.entrySet()) {
            intent.putExtra(entry.getKey(), entry.getValue());
        }
    }
    activity.startActivity(intent);
    activity.finish();
}

From source file:gov.wa.wsdot.android.wsdot.ui.BlogDetailsFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    Bundle args = activity.getIntent().getExtras();
    mTitle = args.getString("title");
    mContent = args.getString("content");
    mLink = args.getString("link");
}

From source file:gov.wa.wsdot.android.wsdot.ui.FacebookDetailsFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    Bundle args = activity.getIntent().getExtras();
    mCreatedAt = args.getString("createdAt");
    mText = args.getString("text");
    mHtmlText = args.getString("htmlText");
}

From source file:gov.wa.wsdot.android.wsdot.ui.TwitterDetailsFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    Bundle args = activity.getIntent().getExtras();
    mUserName = args.getString("userName");
    mCreatedAt = args.getString("createdAt");
    mText = args.getString("text");
    mHtmlText = args.getString("htmlText");
}

From source file:gov.wa.wsdot.android.wsdot.ui.NewsDetailsFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    Bundle args = activity.getIntent().getExtras();
    mTitle = args.getString("title");
    mDescription = args.getString("description");
    mLink = args.getString("link");
    mPublishDate = args.getString("publishDate");
}

From source file:gov.wa.wsdot.android.wsdot.ui.MountainPassItemReportFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    Bundle args = activity.getIntent().getExtras();

    mWeatherCondition = args.getString("WeatherCondition");
    mTemperatureInFahrenheit = args.getString("TemperatureInFahrenheit");

    if (mWeatherCondition.equals(""))
        mWeatherCondition = "Not available";
    if (mTemperatureInFahrenheit.equals("null")) {
        mTemperatureInFahrenheit = "Not available";
    } else {/*from   ww w.j a  v a  2  s.  c om*/
        mTemperatureInFahrenheit = mTemperatureInFahrenheit + "\u00b0F";
    }

    mDateUpdated = args.getString("DateUpdated");
    mElevationInFeet = args.getString("ElevationInFeet");
    mRoadCondition = args.getString("RoadCondition");
    mRestrictionOneTravelDirection = args.getString("RestrictionOneTravelDirection");
    mRestrictionOneText = args.getString("RestrictionOneText");
    mRestrictionTwoTravelDirection = args.getString("RestrictionTwoTravelDirection");
    mRestrictionTwoText = args.getString("RestrictionTwoText");
}

From source file:gov.wa.wsdot.android.wsdot.ui.FerriesRouteAlertsBulletinDetailsFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    Bundle args = activity.getIntent().getExtras();
    Date date = new Date(Long.parseLong(args.getString("AlertPublishDate")));
    mAlertPublishDate = displayDateFormat.format(date);
    mAlertDescription = args.getString("AlertDescription");
    mAlertFullText = args.getString("AlertFullText");
    mContent = formatText(mAlertPublishDate, mAlertDescription, mAlertFullText);
}

From source file:com.ui.UiActivity.java

public void startActivity(Activity activity, Class<?> zls, final Map<String, String> intentParameter) {
    Intent intent = (Intent) activity.getIntent();
    intent.setClass(activity.getBaseContext(), zls);
    if (null != intentParameter) {
        for (Map.Entry<String, String> entry : intentParameter.entrySet()) {
            intent.putExtra(entry.getKey(), entry.getValue());
        }//from w  w  w.java  2 s .c om
    }
    activity.startActivity(intent);
    activity.finish();
}