Projects >> dajkta-location-based-social-network >>34d81389feebe8eb1604fce896a656d17150cc9c

Chunk
Conflicting content
import fi.local.social.network.db.UserImpl;
import com.example.android.actionbarcompat.*;

<<<<<<< HEAD
public class PeopleActivity extends ActionBarActivity {
	
=======
public class PeopleActivity extends ListActivity {

>>>>>>> 2c4f783baff15bfdf81dfd5122b054ef5333c7ff
	List peopleNearby;
	private UserDataSource userDatasource;
	public static String USERNAME = "";
Solution content
import fi.local.social.network.db.UserImpl;
import com.example.android.actionbarcompat.*;

public class PeopleActivity extends ActionBarActivity {
	
	List peopleNearby;
	private UserDataSource userDatasource;
	public static String USERNAME = "";
File
PeopleActivity.java
Developer's decision
Version 1
Kind of conflict
Class signature
Chunk
Conflicting content
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
<<<<<<< HEAD
		
		setContentView(R.layout.people);
		
=======

>>>>>>> 2c4f783baff15bfdf81dfd5122b054ef5333c7ff
		// TODO: get real people and their names
		// add some mockup values
		peopleNearby = new ArrayList();
Solution content
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.people);
		
		// TODO: get real people and their names
		// add some mockup values
		peopleNearby = new ArrayList();
File
PeopleActivity.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
		peopleNearby.add(new UserImpl("Jason Stathon","add uri for pic"));
		peopleNearby.add(new UserImpl("Joe Hu", "add uri for pic"));

<<<<<<< HEAD
		ArrayAdapter adapter = new ArrayAdapter(this, R.layout.people_item, R.id.label, peopleNearby);
		
		ListView listView = (ListView) findViewById(R.id.mylist);
		listView.setAdapter((ListAdapter) adapter );
		
		listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
			@Override
			public void onItemClick(AdapterView parent, View view, int position, long id) {
				Intent intent = new Intent(getApplicationContext(), ChatActivity.class);
				//intent.putExtra("username", this.USERNAME);
				//Object o = listView.getItemAtPosition(position);
			    String receiverName = view.toString();
				intent.putExtra("receiver", receiverName.toString());
				startActivity(intent);
			}
		});
		
=======
		setListAdapter((ListAdapter) new ArrayAdapter(this, R.layout.people_item, R.id.label, peopleNearby));


>>>>>>> 2c4f783baff15bfdf81dfd5122b054ef5333c7ff
		userDatasource = new UserDataSource(this);
		userDatasource.open();
		List allEntries = userDatasource.getAllEntries();
Solution content
		peopleNearby.add(new UserImpl("Jason Stathon","add uri for pic"));
		peopleNearby.add(new UserImpl("Joe Hu", "add uri for pic"));

		ArrayAdapter adapter = new ArrayAdapter(this, R.layout.people_item, R.id.label, peopleNearby);
		
		ListView listView = (ListView) findViewById(R.id.mylist);
		listView.setAdapter((ListAdapter) adapter );
		
		listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
			@Override
			public void onItemClick(AdapterView parent, View view, int position, long id) {
				Intent intent = new Intent(getApplicationContext(), ChatActivity.class);
				//intent.putExtra("username", this.USERNAME);
				//Object o = listView.getItemAtPosition(position);
			    String receiverName = view.toString();
				intent.putExtra("receiver", receiverName.toString());
				startActivity(intent);
			}
		});
		
		userDatasource = new UserDataSource(this);
		userDatasource.open();
		List allEntries = userDatasource.getAllEntries();
File
PeopleActivity.java
Developer's decision
Version 1
Kind of conflict
Cast expression
Method invocation
Variable
Chunk
Conflicting content
	}

	@Override
<<<<<<< HEAD
=======
	protected void onListItemClick(ListView l, View view, int position, long id) {
		startActivityForResult( (new Intent(getApplicationContext(), DeviceListActivity.class)),
				BluetoothChatService.REQUEST_CONNECT_DEVICE );
		Message message = Message.obtain(null, BluetoothChatService.MSG_SEND_EVENT);
//		Bundle b = new Bundle();
//		b.putString("str1", buffer.toString());
		//		message.setData(b);
		try {
			mService.send(message);
		} catch (RemoteException e) {
			e.printStackTrace();
		}


		// TODO
//		Intent intent = new Intent(getApplicationContext(), ChatActivity.class);
//		intent.putExtra("username", this.USERNAME);
//		Object o = this.getListAdapter().getItem(position);
//		String receiverName = o.toString();
//		intent.putExtra("receiver", receiverName.toString());
//		startActivity(intent);
	}

	@Override
>>>>>>> 2c4f783baff15bfdf81dfd5122b054ef5333c7ff
	public boolean onCreateOptionsMenu(Menu menu){
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.layout.menu, menu);
Solution content
	}

	@Override
	protected void onListItemClick(ListView l, View view, int position, long id) {
		startActivityForResult( (new Intent(getApplicationContext(), DeviceListActivity.class)),
				BluetoothChatService.REQUEST_CONNECT_DEVICE );
		Message message = Message.obtain(null, BluetoothChatService.MSG_SEND_EVENT);
//		Bundle b = new Bundle();
//		b.putString("str1", buffer.toString());
		//		message.setData(b);
		try {
			mService.send(message);
		} catch (RemoteException e) {
			e.printStackTrace();
		}


		// TODO
//		Intent intent = new Intent(getApplicationContext(), ChatActivity.class);
//		intent.putExtra("username", this.USERNAME);
//		Object o = this.getListAdapter().getItem(position);
//		String receiverName = o.toString();
//		intent.putExtra("receiver", receiverName.toString());
//		startActivity(intent);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu){
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.layout.menu, menu);
File
PeopleActivity.java
Developer's decision
Version 2
Kind of conflict
Annotation
Method declaration