diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f0fbceb..979915d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -18,7 +18,7 @@ android:label="@string/app_name" android:theme="@style/AppTheme"> @@ -29,28 +29,28 @@ + android:value=".MainActivity" /> + android:value=".MainActivity" /> + android:parentActivityName=".MainActivity"> + android:value=".MainActivity" /> @@ -79,7 +79,7 @@ + android:parentActivityName=".MainActivity"> diff --git a/app/src/main/java/ch/dissem/apps/abit/MessageListActivity.java b/app/src/main/java/ch/dissem/apps/abit/MainActivity.java similarity index 96% rename from app/src/main/java/ch/dissem/apps/abit/MessageListActivity.java rename to app/src/main/java/ch/dissem/apps/abit/MainActivity.java index b21acb1..6f444ad 100644 --- a/app/src/main/java/ch/dissem/apps/abit/MessageListActivity.java +++ b/app/src/main/java/ch/dissem/apps/abit/MainActivity.java @@ -42,6 +42,8 @@ import org.slf4j.LoggerFactory; import java.io.Serializable; import java.lang.ref.WeakReference; import java.util.ArrayList; +import java.util.Collection; +import java.util.List; import ch.dissem.apps.abit.listener.ActionBarListener; import ch.dissem.apps.abit.listener.ListSelectionListener; @@ -77,12 +79,12 @@ import static ch.dissem.apps.abit.synchronization.StubProvider.AUTHORITY; * to listen for item selections. *

*/ -public class MessageListActivity extends AppCompatActivity +public class MainActivity extends AppCompatActivity implements ListSelectionListener, ActionBarListener { public static final String EXTRA_SHOW_MESSAGE = "ch.dissem.abit.ShowMessage"; public static final String ACTION_SHOW_INBOX = "ch.dissem.abit.ShowInbox"; - private static final Logger LOG = LoggerFactory.getLogger(MessageListActivity.class); + private static final Logger LOG = LoggerFactory.getLogger(MainActivity.class); private static final long SYNC_FREQUENCY = 15 * 60; // seconds private static final int ADD_IDENTITY = 1; @@ -99,8 +101,8 @@ public class MessageListActivity extends AppCompatActivity private static ServiceConnection connection = new ServiceConnection() { @Override public void onServiceConnected(ComponentName name, IBinder service) { - MessageListActivity.service = new Messenger(service); - MessageListActivity.bound = true; + MainActivity.service = new Messenger(service); + MainActivity.bound = true; } @Override @@ -121,8 +123,10 @@ public class MessageListActivity extends AppCompatActivity super.onCreate(savedInstanceState); messageRepo = Singleton.getMessageRepository(this); addressRepo = Singleton.getAddressRepository(this); - - selectedLabel = messageRepo.getLabels().get(0); + List