Fix application and first activity titles bug.

Change-Id: I066af1301c8e5525b5ade310c770273f72007b10
This commit is contained in:
Artur Dryomov
2013-07-30 15:55:38 +03:00
parent 2ba929e40c
commit c01a2c8284
3 changed files with 15 additions and 4 deletions

View File

@@ -21,10 +21,9 @@
<activity
android:name=".activity.ComputersActivity"
android:label="@string/title_computers"
android:theme="@style/Theme.ImpressRemote.Computers">
<intent-filter android:label="@string/application_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

View File

@@ -31,8 +31,8 @@
<item name="android:navigationMode">tabMode</item>
<item name="navigationMode">tabMode</item>
<item name="android:displayOptions">showTitle|showHome|useLogo</item>
<item name="displayOptions">showTitle|showHome|useLogo</item>
<item name="android:displayOptions">showHome|useLogo</item>
<item name="displayOptions">showHome|useLogo</item>
</style>
<style name="Theme.ImpressRemote.ComputerCreation" parent="Theme.ImpressRemote">

View File

@@ -31,9 +31,21 @@ public class ComputersActivity extends SherlockFragmentActivity implements Actio
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setUpTitle();
setUpContent();
}
private void setUpTitle() {
// Looks hacky but it seems to be the best way to set activity title
// different to applications label. The other way is setting title
// to intents filter but it shows wrong label for recent apps screen.
ActionBar aActionBar = getSupportActionBar();
aActionBar.setTitle(R.string.title_computers);
aActionBar.setDisplayShowTitleEnabled(true);
}
private void setUpContent() {
if (BluetoothOperator.isAvailable()) {
setUpComputersLists();