java - My ArrayList<NameValuePair> is showing NameValuePair can not resolve -
this question has answer here:
can 1 give me complete code http , post request android https://wowjava.wordpress.com/2011/01/16/login-application-for-android/ . please wanted make login check server.so want make post request please me. new android
developer can not resolving issue.so please me.
build.gradle (module:app):
apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.2" defaultconfig { applicationid "com.systechdigital.realtimetrackingandmonitoring" minsdkversion 17 targetsdkversion 23 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) testcompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' compile 'com.android.support:support-v4:23.1.1' }
my mainactivity:
package com.systechdigital.realtimetrackingandmonitoring; import android.content.intent; import android.os.bundle; import android.view.view; import android.support.design.widget.navigationview; import android.support.v4.view.gravitycompat; import android.support.v4.widget.drawerlayout; import android.support.v7.app.appcompatactivity; import android.view.menu; import android.view.menuitem; import android.widget.button; import android.widget.edittext; import android.widget.imageview; import org.apache.http.message.basicnamevaluepair; import org.apache.http.namevaluepair; public class mainactivity extends appcompatactivity implements navigationview.onnavigationitemselectedlistener { imageview icon_image; imageview login_image; edittext username_edittext; edittext password_edittext; button remember_me_button; button forget_password_button; button sign_up_button; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); icon_image =(imageview)findviewbyid(r.id.icon_imageview_id); login_image=(imageview)findviewbyid(r.id.imageview_login_id); username_edittext=(edittext)findviewbyid(r.id.user_login_email_id); password_edittext=(edittext)findviewbyid(r.id.login_password); remember_me_button=(button)findviewbyid(r.id.remember_me_id); forget_password_button=(button)findviewbyid(r.id.forget_password_id); sign_up_button=(button)findviewbyid(r.id.sign_up_button_id); login_image.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { intent maintosignupintent=new intent(getapplicationcontext(),signupactivity.class); startactivity(maintosignupintent); arraylist<namevaluepair> postparameters = new arraylist<namevaluepair>(); } }); } @override public void onbackpressed() { drawerlayout drawer = (drawerlayout) findviewbyid(r.id.drawer_layout); if (drawer.isdraweropen(gravitycompat.start)) { drawer.closedrawer(gravitycompat.start); } else { super.onbackpressed(); } } @suppresswarnings("statementwithemptybody") @override public boolean onnavigationitemselected(menuitem item) { // handle navigation view item clicks here. int id = item.getitemid(); if (id == r.id.nav_camera) { // handle camera action } else if (id == r.id.nav_gallery) { } else if (id == r.id.nav_slideshow) { } else if (id == r.id.nav_manage) { } else if (id == r.id.nav_share) { } else if (id == r.id.nav_send) { } drawerlayout drawer = (drawerlayout) findviewbyid(r.id.drawer_layout); drawer.closedrawer(gravitycompat.start); return true; } }
arraylist<namevaluepair> postparameters = new arraylist<namevaluepair>();
this wrong declaration, instead of namevaluepair
suppose giving datatype of arraylist
containing element such
arraylist<string> postparameters = new arraylist<string>();
Comments
Post a Comment