Home | History | Annotate | Download | only in nfc
      1 /*
      2  * Copyright (C) 2008 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.nfc;
     18 
     19 import com.android.internal.app.ResolverActivity;
     20 
     21 import android.content.Intent;
     22 import android.content.pm.ResolveInfo;
     23 import android.os.Bundle;
     24 import android.os.Parcelable;
     25 import android.util.Log;
     26 
     27 import java.util.ArrayList;
     28 
     29 public class TechListChooserActivity extends ResolverActivity {
     30     public static final String EXTRA_RESOLVE_INFOS = "rlist";
     31 
     32     @Override
     33     protected void onCreate(Bundle savedInstanceState) {
     34         Intent intent = getIntent();
     35         Parcelable targetParcelable = intent.getParcelableExtra(Intent.EXTRA_INTENT);
     36         if (!(targetParcelable instanceof Intent)) {
     37             Log.w("TechListChooserActivity", "Target is not an intent: " + targetParcelable);
     38             finish();
     39             return;
     40         }
     41         Intent target = (Intent)targetParcelable;
     42         ArrayList<ResolveInfo> rList = intent.getParcelableArrayListExtra(EXTRA_RESOLVE_INFOS);
     43         CharSequence title = getResources().getText(com.android.internal.R.string.chooseActivity);
     44         super.onCreate(savedInstanceState, target, title, null, rList, false);
     45     }
     46 }
     47