• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2019 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.music;
18 
19 import android.app.ListActivity;
20 import android.content.Intent;
21 import android.net.Uri;
22 import android.os.Bundle;
23 import android.provider.MediaStore;
24 import android.util.Log;
25 import android.view.Menu;
26 import android.view.MenuItem;
27 import android.view.View;
28 import android.widget.ListView;
29 
30 /**
31  * A placeholder class to handle android.intent.action.PICK Intent.
32  */
33 public class MusicPicker extends ListActivity implements View.OnClickListener {
34     static final boolean DBG = false;
35     static final String TAG = "MusicPicker";
36 
37     /** Uri to the directory of all music being displayed. */
38     Uri mBaseUri;
39 
40     /** Called when the activity is first created. */
41     @Override
onCreate(Bundle icicle)42     public void onCreate(Bundle icicle) {
43         super.onCreate(icicle);
44         if (Intent.ACTION_GET_CONTENT.equals(getIntent().getAction())) {
45             mBaseUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
46         } else {
47             mBaseUri = getIntent().getData();
48         }
49         Log.w("MusicPicker", "Doesn't handle for data URI given to PICK action");
50     }
51 
52     @Override
onRestart()53     public void onRestart() {
54         super.onRestart();
55     }
56 
57     @Override
onOptionsItemSelected(MenuItem item)58     public boolean onOptionsItemSelected(MenuItem item) {
59         return super.onOptionsItemSelected(item);
60     }
61 
62     @Override
onCreateOptionsMenu(Menu menu)63     public boolean onCreateOptionsMenu(Menu menu) {
64         super.onCreateOptionsMenu(menu);
65         return true;
66     }
67 
68     @Override
onSaveInstanceState(Bundle icicle)69     protected void onSaveInstanceState(Bundle icicle) {
70         super.onSaveInstanceState(icicle);
71     }
72 
73     @Override
onPause()74     public void onPause() {
75         super.onPause();
76     }
77 
78     @Override
onStop()79     public void onStop() {
80         super.onStop();
81     }
82 
83     @Override
onListItemClick(ListView l, View v, int position, long id)84     protected void onListItemClick(ListView l, View v, int position, long id) {}
85 
onClick(View v)86     public void onClick(View v) {}
87 }
88