
- Forum posts: 1
Dec 18, 2016, 10:20:21 PM via Website
Dec 18, 2016 10:20:21 PM via Website
Hi everyone so I'm kind of new to all of this, and my instructor has some extra code inside of the home class as well as three vertical dots inside of the action bar. He is doing stuff with it and I am not able to catch up because all I have in the action bar is the name of my project. Any help would be appreciated. Here is my code:
package com.example.gamee.taskit;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_task_list);
mItems[0] = new Task();
mItems[0].setName("Task 1");
mItems[0].setUpdatedDate("NULL");
mItems[1] = new Task();
mItems[1].setName("Task 2");
mItems[1].setUpdatedDate("NULL");
mItems[2] = new Task();
mItems[2].setName("Task 3");
mItems[2].setUpdatedDate("NULL");
mItems[3] = new Task();
mItems[3].setName("Task 4");
mItems[3].setUpdatedDate("NULL");
for (Task items : mItems) {
items.setDate(new Date());
}
mAdapter = new TaskAdapter(mItems);
ListView list = (ListView) findViewById(R.id.list);
list.setAdapter(mAdapter);
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
mTaskLocation = position;
Task task = mItems[position];
task.setPosition(position);
Intent i = new Intent(TaskListActivity.this, SetTaskActivity.class);
i.putExtra(EXTRA, task);
startActivityForResult(i, REQUEST_CODE);
}
});
Also here is my android manifest. Not exactly sure what an android manifest is to be honest, but when I looked at an error it mentioned it. So if someone could explain what an android manifest is that would be great!
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".SetTaskActivity">
</activity>