Intent getType - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:getType
	} 
 
	@Kroll.method @Kroll.getProperty 
	public String getType()
	{ 
		return intent.getType();
	} 
 
	@Kroll.method @Kroll.setProperty 
	public void setType(String type)
	{ 
		intent.setType(type);
	} 
 
	@Kroll.method @Kroll.getProperty 
	public String getAction()
	{ 
		return intent.getAction();
	} 
 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getAction, getType, setType
        } 
    } 
 
    private void initializeByIntent() { 
        Intent intent = getIntent();
        String action = intent.getAction();
 
        if (Intent.ACTION_GET_CONTENT.equalsIgnoreCase(action)) {
            startGetContent(intent);
        } else if (Intent.ACTION_PICK.equalsIgnoreCase(action)) {
            // We do NOT really support the PICK intent. Handle it as 
            // the GET_CONTENT. However, we need to translate the type 
            // in the intent here. 
            Log.w(TAG, "action PICK is not supported");
            String type = Utils.ensureNotNull(intent.getType());
            if (type.startsWith("vnd.android.cursor.dir/")) {
                if (type.endsWith("/image")) intent.setType("image/*");
                if (type.endsWith("/video")) intent.setType("video/*");
            } 
            startGetContent(intent);

8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getAction, getCategories, getComponent, getData, getPackage
  // cribbed from Android source 
  public boolean filterEquals(Intent other) {
    if (other == null) {
      return false; 
    } 
    if (getAction() != other.getAction()) {
      if (getAction() != null) { 
        if (!getAction().equals(other.getAction())) {
          return false; 
        } 
      } else { 
        if (!other.getAction().equals(getAction())) {
          return false; 
        } 
      } 
    } 
    if (getData() != other.getData()) {
      if (getData() != null) { 
        if (!getData().equals(other.getData())) {
          return false; 

8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getAction, getCategories, getComponent, getData, getPackage
    // cribbed from Android source 
    public boolean filterEquals(Intent other) {
        if (other == null) {
            return false; 
        } 
        if (getAction() != other.getAction()) {
            if (getAction() != null) { 
                if (!getAction().equals(other.getAction())) {
                    return false; 
                } 
            } else { 
                if (!other.getAction().equals(getAction())) {
                    return false; 
                } 
            } 
        } 
        if (getData() != other.getData()) {
            if (getData() != null) { 
                if (!getData().equals(other.getData())) {
                    return false; 

8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getType
        // Use ArrayList for the moment, since we don't know the size of 
        // Cursor[]. If the length of Corsor[] larger than really used, 
        // a NPE will come up when access the content of Corsor[]. 
        ArrayList<Cursor> cList = new ArrayList<Cursor>();
        Intent intent = getIntent();
        String type = intent.getType();
 
        if (mFirstYear != null) {
            // If mFirstYear is not null, the picker only for audio because 
            // video has no year column. 
            if(type.equals("video/*")) {
                mCursor = null;
                return; 
            } 
 
            mWhereClause = MediaStore.Audio.Media.YEAR + ">=" + mFirstYear + " AND " +
                           MediaStore.Audio.Media.YEAR + "<=" + mLastYear;
        } 
 
        // If use Cursor[] as before, the Cursor[i] could be null when there is 

5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:addFlags, getType, putExtra, putParcelableArrayListExtra, setAction
                        ? Uri.fromFile(screenShot) : null;
                intent = getSendMailIntent(bugreportUri, screenshotUri);
            } 
            final IActivityManager mAm = ActivityManagerNative.getDefault();
            try { 
                mAm.startActivity(null, intent, intent.getType(), null, 0, null, null, 0, false,
                        false, null, null, false); 
            } catch (RemoteException e) {
                // ignore 
            } 
        } 
    } 
 
    private Intent tryBugReporter(Uri bugreportUri) {
        final Intent intent = new Intent(SEND_BUG_INTENT_ACTION);
        intent.setData(bugreportUri);
        final IPackageManager mPm = IPackageManager.Stub.asInterface(
                ServiceManager.getService("package")); 
        if (mPm != null) {
            final List<ResolveInfo> results;

4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Intent getType Questions & Answers:

getType Method Overview
Retrieve any explicit MIME type included in the intent.
See Code Examples for other Android Intent Methods: