package com.linseykate.findingfido; /** * Activity that handles updating notifications * if a match was found */ import android.provider.Settings; import android.support.v4.app.NavUtils; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.view.MenuItem; import android.widget.ArrayAdapter; import android.widget.ListView; public class NotificationsActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_notifications); ListView mNotifications = (ListView) findViewById(R.id.lvNotifications); String[] tempNotifications = ((GlobalVariables) getApplication()).getNotifications(); if(tempNotifications==null){ tempNotifications = new String[1]; tempNotifications[0] = "No notifications!"; } ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, tempNotifications); mNotifications.setAdapter(adapter); } }