Browse Source

adasdad

old
Yiğit Çolakoğlu 6 years ago
parent
commit
f9a875b9be
2 changed files with 9 additions and 2 deletions
  1. +1
    -1
      MyCity/app/src/main/java/gq/yigit/mycity/MainActivity.java
  2. +8
    -1
      MyCity/app/src/main/java/gq/yigit/mycity/voteFragment/VoteFragment.java

+ 1
- 1
MyCity/app/src/main/java/gq/yigit/mycity/MainActivity.java View File

@ -47,7 +47,7 @@ public class MainActivity extends AppCompatActivity
imageListener {
private Context cntxt;
private static JSONObject userData;
public static JSONObject userData;
public static Bitmap userAvatar;
private String url;
private ImageView avatarView;


+ 8
- 1
MyCity/app/src/main/java/gq/yigit/mycity/voteFragment/VoteFragment.java View File

@ -11,9 +11,11 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.*;
import gq.yigit.mycity.MainActivity;
import gq.yigit.mycity.R;
import gq.yigit.mycity.tools.*;
import gq.yigit.mycity.tools.WebRequest.responseListener;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
@ -164,7 +166,12 @@ public class VoteFragment extends Fragment implements responseListener, imageLis
HashMap<String,String> params = new HashMap<>();
params.put("voting_id",vote_id);
params.put("vote_id",user_vote);
WebRequest vote_request = new WebRequest(url+"/vote",true, params);
try {
params.put("voter_id", MainActivity.userData.get("id").toString());
}catch (JSONException e){
Log.e("[ERROR]","Cannot get user data");
}
WebRequest vote_request = new WebRequest(url+"/vote",false, params);
vote_request.execute();
}else{
Toast.makeText(cntxt,"Please selet a vote!",Toast.LENGTH_SHORT).show();


Loading…
Cancel
Save