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 |
|
@author |
35 |
|
|
|
|
| 92,3% |
Uncovered Elements: 1 (13) |
Complexity: 2 |
Complexity Density: 0,2 |
|
36 |
|
public class QueryReceiverActivity extends Activity { |
37 |
|
|
|
|
| 91,7% |
Uncovered Elements: 1 (12) |
Complexity: 2 |
Complexity Density: 0,2 |
|
38 |
1
|
@Override... |
39 |
|
public void onCreate(Bundle savedInstanceState) { |
40 |
1
|
super.onCreate(savedInstanceState); |
41 |
|
|
42 |
1
|
String query = getIntent().getStringExtra(SearchManager.QUERY); |
43 |
|
|
44 |
1
|
if (query != null) { |
45 |
1
|
SearchRecentSuggestions suggestions = new SearchRecentSuggestions(this, SearchSuggestionProvider.AUTHORITY, |
46 |
|
SearchSuggestionProvider.MODE); |
47 |
1
|
suggestions.saveRecentQuery(query, null); |
48 |
|
|
49 |
1
|
Intent intent = new Intent(QueryReceiverActivity.this, SearchActivity.class); |
50 |
1
|
intent.putExtra(Constants.INTENT_EXTRA_NAME_QUERY, query); |
51 |
1
|
Util.startActivityWithoutTransition(QueryReceiverActivity.this, intent); |
52 |
|
} |
53 |
1
|
finish(); |
54 |
1
|
Util.disablePendingTransition(this); |
55 |
|
} |
56 |
|
} |