mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 10:48:46 +00:00
Can now remove items from database
This commit is contained in:
parent
1d4704483f
commit
cd1dbf2589
@ -91,6 +91,7 @@ public class ListPage extends AppCompatActivity {
|
|||||||
pPrices.add(item.getPrice().toString());
|
pPrices.add(item.getPrice().toString());
|
||||||
pQuantity.add("1");
|
pQuantity.add("1");
|
||||||
pImages.add(R.drawable.placeholder);
|
pImages.add(R.drawable.placeholder);
|
||||||
|
pListItemPair.add(entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -189,7 +190,7 @@ public class ListPage extends AppCompatActivity {
|
|||||||
pQuantity.remove(position);
|
pQuantity.remove(position);
|
||||||
pImages.remove(position);
|
pImages.remove(position);
|
||||||
|
|
||||||
//requestor.deleteObject("39", ListEntry.class);
|
requestor.deleteObject(pListItemPair.remove(position));
|
||||||
|
|
||||||
listView.setAdapter(myAdapter);
|
listView.setAdapter(myAdapter);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.example.listify.ui.home;
|
|||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
|
||||||
@ -43,10 +44,10 @@ public class HomeFragment extends Fragment {
|
|||||||
toListPage.setOnClickListener(new View.OnClickListener() {
|
toListPage.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
//Intent intent = new Intent(HomeFragment.this.getActivity(), com.example.listify.ListPage.class);
|
Intent intent = new Intent(HomeFragment.this.getActivity(), com.example.listify.ListPage.class);
|
||||||
//startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
||||||
try {
|
/*try {
|
||||||
Properties configs = new Properties();
|
Properties configs = new Properties();
|
||||||
try {
|
try {
|
||||||
configs = AuthManager.loadProperties(getContext(), "android.resource://" + getActivity().getPackageName() + "/raw/auths.json");
|
configs = AuthManager.loadProperties(getContext(), "android.resource://" + getActivity().getPackageName() + "/raw/auths.json");
|
||||||
@ -56,7 +57,9 @@ public class HomeFragment extends Fragment {
|
|||||||
Requestor requestor = new Requestor(am, configs.getProperty("apiKey"));
|
Requestor requestor = new Requestor(am, configs.getProperty("apiKey"));
|
||||||
am.deleteUser(requestor);
|
am.deleteUser(requestor);
|
||||||
}
|
}
|
||||||
catch(Exception ex) {}
|
catch (Exception e) {
|
||||||
|
Log.i("Authentication", e.toString());
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user