• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 **
3 ** Copyright 2006, The Android Open Source Project
4 **
5 ** Licensed under the Apache License, Version 2.0 (the "License");
6 ** you may not use this file except in compliance with the License.
7 ** You may obtain a copy of the License at
8 **
9 **     http://www.apache.org/licenses/LICENSE-2.0
10 **
11 ** Unless required by applicable law or agreed to in writing, software
12 ** distributed under the License is distributed on an "AS IS" BASIS,
13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ** See the License for the specific language governing permissions and
15 ** limitations under the License.
16 */
17 
18 package com.android.development;
19 
20 import android.app.Activity;
21 import android.content.Intent;
22 import android.content.pm.PackageManager;
23 import android.os.Bundle;
24 import android.widget.LinearLayout;
25 import android.widget.TextView;
26 
27 public class ProcessInfo extends Activity {
28     PackageManager mPm;
29 
30     @Override
onCreate(Bundle icicle)31     protected void onCreate(Bundle icicle) {
32         super.onCreate(icicle);
33         Intent intent = getIntent();
34         String processName = intent.getStringExtra("processName");
35         String pkgList[] = intent.getStringArrayExtra("packageList");
36         mPm = getPackageManager();
37         setContentView(R.layout.process_info);
38        TextView processNameView = (TextView) findViewById(R.id.process_name);
39        LinearLayout pkgListView = (LinearLayout) findViewById(R.id.package_list);
40        if(processName != null) {
41            processNameView.setText(processName);
42        }
43        if(pkgList != null) {
44            for(String pkg : pkgList) {
45                TextView pkgView = new TextView(this);
46                pkgView.setText(pkg);
47                pkgListView.addView(pkgView);
48            }
49        }
50     }
51 
52     @Override
onResume()53     protected void onResume() {
54         super.onResume();
55     }
56 
57     @Override
onStop()58     protected void onStop() {
59         super.onStop();
60     }
61 }
62 
63