1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package net.sourceforge.subsonic.androidapp.activity; |
21 |
|
|
22 |
|
import android.app.Activity; |
23 |
|
import android.app.SearchManager; |
24 |
|
import android.content.Intent; |
25 |
|
import android.os.Bundle; |
26 |
|
import android.provider.SearchRecentSuggestions; |
27 |
|
import net.sourceforge.subsonic.androidapp.util.Constants; |
28 |
|
import net.sourceforge.subsonic.androidapp.util.Util; |
29 |
|
import net.sourceforge.subsonic.androidapp.provider.SearchSuggestionProvider; |
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
@author |
37 |
|
|
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 2 |
Complexity Density: 0,18 |
|
38 |
|
public class VoiceQueryReceiverActivity extends Activity { |
39 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 2 |
Complexity Density: 0,18 |
|
40 |
0
|
@Override... |
41 |
|
public void onCreate(Bundle savedInstanceState) { |
42 |
0
|
super.onCreate(savedInstanceState); |
43 |
|
|
44 |
0
|
String query = getIntent().getStringExtra(SearchManager.QUERY); |
45 |
|
|
46 |
0
|
if (query != null) { |
47 |
0
|
SearchRecentSuggestions suggestions = new SearchRecentSuggestions(this, SearchSuggestionProvider.AUTHORITY, |
48 |
|
SearchSuggestionProvider.MODE); |
49 |
0
|
suggestions.saveRecentQuery(query, null); |
50 |
|
|
51 |
0
|
Intent intent = new Intent(VoiceQueryReceiverActivity.this, SearchActivity.class); |
52 |
0
|
intent.putExtra(Constants.INTENT_EXTRA_NAME_QUERY, query); |
53 |
0
|
intent.putExtra(Constants.INTENT_EXTRA_NAME_AUTOPLAY, true); |
54 |
0
|
Util.startActivityWithoutTransition(VoiceQueryReceiverActivity.this, intent); |
55 |
|
} |
56 |
0
|
finish(); |
57 |
0
|
Util.disablePendingTransition(this); |
58 |
|
} |
59 |
|
} |