Намерение не работает в просмотре карты. Тост работает, но намерение не работает в этом, как я могу работать с этим, пожалуйста, помогите сделать это
Это ошибка в logcats E / HAL: hw_get_module_by_class: имя модуля grallo c
Я не могу найти путь к намерению, Это делает меня совершенно смущенным и пустым, Почему? Это случается со мной вот так, если кто-нибудь знает это, пожалуйста, помогите мне, друзья, которых я слишком много волновал в этом на месте, пожалуйста, мой Mainactivity
package com.onebook.msv;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import android.view.View;
import androidx.cardview.widget.CardView;
import androidx.core.view.GravityCompat;
import androidx.appcompat.app.ActionBarDrawerToggle;
import android.view.MenuItem;
import com.google.android.material.navigation.NavigationView;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.Menu;
import android.widget.GridLayout;
import android.widget.TextView;
import android.widget.Toast;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
public class MainActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
private GridLayout gridLayout;
private CardView card1,card2,card3,card4,card5;
private TextView c1t1,c1t2,c2t1,c2t2,c3t1,c3t2,c4t1,c4t2,c5t1,c5t2;
Session_Manager sm;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
gridLayout=(GridLayout)findViewById(R.id.gridlayout);
setsingleevent(gridLayout);
/* Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = findViewById(R.id.fab);*/
/* fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});*/
DrawerLayout drawer = findViewById(R.id.drawer_layout);
NavigationView navigationView = findViewById(R.id.nav_view);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
toggle.syncState();
navigationView.setNavigationItemSelectedListener(this);
}
private void setsingleevent(GridLayout gridLayout){
for (int i=0;i<gridLayout.getChildCount();i++){
CardView cardView=(CardView)gridLayout.getChildAt(i);
final int finalI=i;
if (i==0) {
c1t2=gridLayout.findViewById(R.id.card1txtview2);
c1t2.setText("1958 ");
cardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(MainActivity.this,Listapproval.class);
startActivity(intent);
}
});
}
if (i==1) {
c2t2=gridLayout.findViewById(R.id.card2txtview2);
c2t2.setText("1958 ");
cardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this, "This is in the postion" + finalI, Toast.LENGTH_LONG).show();
}
});
}
if (i==2) {
c3t2=gridLayout.findViewById(R.id.card3txtview2);
c3t2.setText("1958 ");
cardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this, "This is in the postion" + finalI, Toast.LENGTH_LONG).show();
}
});
}
if (i==3) {
c4t2=gridLayout.findViewById(R.id.card4txtview2);
c4t2.setText("195 ");
cardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this, "This is in the postion" + finalI, Toast.LENGTH_LONG).show();
}
});
}
if (i==4) {
c5t2=gridLayout.findViewById(R.id.card5txtview2);
c5t2.setText("195 ");
cardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this, "This is in the postion" + finalI, Toast.LENGTH_LONG).show();
}
});
}
}
ProgressDialog progressDialog;
progressDialog = new ProgressDialog(MainActivity.this);
progressDialog.setMessage("Please wait");
progressDialog.show();
progressDialog.setCancelable(false);
try {
URL url = new URL("http://squaredotssolutions.com/demo/chit/api/total_details.php");
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setDoOutput(true);
httpURLConnection.setDoInput(true);
OutputStream os = httpURLConnection.getOutputStream();
BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(os, "UTF-8"));
/* String inputuserid = userid.getText().toString();
String inputPassword = password.getText().toString();*/
String data = "status=" + URLEncoder.encode("1", "UTF-8");
bufferedWriter.write(data);
bufferedWriter.flush();
bufferedWriter.close();
os.close();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
String line = "";
String response = "";
while ((line = bufferedReader.readLine()) != null) {
response += line;
}
progressDialog.cancel();
JSONObject response_data = new JSONObject(response);
if (response_data.getString("status").equals("true")) {
/* sm.setLoginmobile(inputuserid);
sm.setLoginpassword(inputPassword);*/
// based on the wanted response we need to change this
/* sm.settotalcustomers(response_data.getJSONObject("customer").getString("totalCustomers"));
sm.settotalcollections(response_data.getJSONObject("collection").getString("totalCollection"));
sm.settotalavailablevalus(response_data.getJSONObject("amt").getString("totalCollection"));
sm.settotalamount(response_data.getString("message"));
sm.setstatus (response_data.getString("status"));
*/
String customer=response_data.getJSONObject("customer").getString("totalCustomers");
// String collection=response_data.getJSONObject("collection").getString("totalCollection");
String available=response_data.getJSONObject("amt").getString("totalAmount");
c1t2.setText(customer);
c2t2.setText("258");
c3t2.setText(available);
c4t2.setText("125");
c5t2.setText("available");
// sm.setAddress(response_data.getJSONObject("data").getString("address"));
sm.setFirstname(response_data.getJSONObject("data").getString("feb_username"));
sm.setEmail(response_data.getJSONObject("data").getString("email"));
sm.setSymbol(response_data.getJSONObject("data").getString("symbol"));
sm.setdialcode(response_data.getJSONObject("data").getString("dial_code"));
//intend for next page
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
startActivity(intent);
} else if (response_data.getString("status").equals("2")) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
alertDialogBuilder
.setMessage("No Datas Available")
.setCancelable(false).setIcon(R.drawable.sorry).setTitle("Login Status")
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
} else {
Toast.makeText(getApplicationContext(),"somthing went wrong", Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onBackPressed() {
DrawerLayout drawer = findViewById(R.id.drawer_layout);
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else {
super.onBackPressed();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.nav_home) {
// Handle the camera action
} else if (id == R.id.nav_gallery) {
} else if (id == R.id.nav_slideshow) {
} else if (id == R.id.nav_tools) {
} else if (id == R.id.nav_share) {
} else if (id == R.id.nav_send) {
}
DrawerLayout drawer = findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}
}
мой класс recycleview
package com.onebook.msv;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
public class Listapproval extends AppCompatActivity {
Session_Manager sm;
List<ListApprovalMode> listApprovalModeslist;
RecyclerView.Adapter adapter;
@Override
public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
super.onCreate(savedInstanceState, persistentState);
setContentView(R.layout.listtoapprove);
listApprovalModeslist=new ArrayList<ListApprovalMode>();
getdata();
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclewlistview);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recyclerView.setLayoutManager(linearLayoutManager);
recyclerView.setHasFixedSize(true);
adapter = new Adapterlist(getApplicationContext(),listApprovalModeslist);
recyclerView.setAdapter(adapter);
}
public void getdata(){
ProgressDialog progressDialog;
progressDialog = new ProgressDialog(Listapproval.this);
progressDialog.setMessage("Please wait");
progressDialog.show();
progressDialog.setCancelable(false);
try {
URL url = new URL("http://squaredotssolutions.com/demo/chit/api/total_details.php");
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setDoOutput(true);
httpURLConnection.setDoInput(true);
OutputStream os = httpURLConnection.getOutputStream();
BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(os, "UTF-8"));
/* String inputuserid = userid.getText().toString();
String inputPassword = password.getText().toString();*/
String data = "status=" + URLEncoder.encode("1", "UTF-8")+ "&category_id=" + URLEncoder.encode("5", "UTF-8");;
bufferedWriter.write(data);
bufferedWriter.flush();
bufferedWriter.close();
os.close();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
String line = "";
String response = "";
while ((line = bufferedReader.readLine()) != null) {
response += line;
}
progressDialog.cancel();
JSONObject response_data = new JSONObject(response);
JSONArray array=response_data.getJSONArray("details");
for(int i=0;i<array.length();i++) {
JSONObject ob=array.getJSONObject(i);
String sno = " ";
String customer_id = " ";
String customer_name = " ";
String account_no = " ";
String category_id = " ";
String category = " ";
String partner_id = " ";
String partner_name = " ";
String amount = " ";
String payin_id = " ";
String payin = " ";
String balance = " ";
if(ob.getString("status").equals("1")) {
sno = ob.getString("sno");
customer_id = ob.getString("customer_id");
customer_name = ob.getString("customer_name");
account_no = ob.getString("account_no");
category_id = ob.getString("category_id");
category = ob.getString("category");
partner_id = ob.getString("partner_id");
partner_name = ob.getString("partner_name");
amount = ob.getString("amount");
payin_id = ob.getString("payin_id");
payin = ob.getString("payin");
balance = ob.getString("balance");
String status = ob.getString("status");
}
listApprovalModeslist.add(0,new ListApprovalMode(sno,customer_id,customer_name,account_no,category_id,category,partner_id,partner_name,amount,payin_id,payin,balance));
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
мой адаптер
package com.onebook.msv;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
class Adapterlist extends RecyclerView.Adapter<Adapterlist.ViewHolder> {
Context context;
List<ListApprovalMode> listApprovalModeslist;
public Adapterlist(Context applicationContext, List<ListApprovalMode> listApprovalModes) {
this.context=applicationContext;
this.listApprovalModeslist=listApprovalModes;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext())
.inflate(R.layout.recycleview_item, parent, false);
return new ViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
ListApprovalMode listApprovalMode=listApprovalModeslist.get(position);
holder.name.setText(listApprovalMode.getCustomer_name());
holder.linid.setText(listApprovalMode.getCustomer_id());
holder.totalamount.setText(listApprovalMode.getAmount());
holder.payin.setText(listApprovalMode.getPayin());
holder.balance.setText((listApprovalMode.getBalance()));
}
@Override
public int getItemCount() {
return listApprovalModeslist.size();
}
public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
TextView name,linid,totalamount,payin,balance;
public ViewHolder(View itemView) {
super(itemView);
name=itemView.findViewById(R.id.editText);
linid=itemView.findViewById(R.id.editText2);
totalamount=itemView.findViewById(R.id.editText3);
payin=itemView.findViewById(R.id.editText4);
balance=itemView.findViewById(R.id.editText5);
itemView.setOnClickListener(this);
}
@Override
public void onClick(View v) {
}
}
}
это мой режим
package com.onebook.msv;
public class ListApprovalMode {
String sno, customer_id, customer_name, account_no, category_id, category, partner_id, partner_name, amount, payin_id, payin, balance;
public ListApprovalMode(String sno, String customer_id, String customer_name, String account_no, String category_id, String category, String partner_id, String partner_name, String amount, String payin_id, String payin, String balance) {
this.sno=sno;
this.customer_id=customer_id;
this.customer_name=customer_name;
this.account_no=account_no;
this.category_id=category_id;
this.category=category;
this.partner_id=partner_id;
this.partner_name=partner_name;
this.amount=amount;
this.payin_id=payin_id;
this.payin=payin;
this.balance=balance;
}
public String getSno(){return sno;}
public void setSno(String sno){this.sno=sno;};
public String getCustomer_id(){return customer_id;}
public void setCustomer_id(String customer_id){this.customer_id=customer_id;}
public String getCustomer_name(){return customer_name;}
public void setCustomer_name(String customer_name){this.customer_name=customer_name;}
public String getAccount_no(){return getAccount_no();}
public void setAccount_no(String account_no){this.account_no=account_no;}
public String getCategory_id(){return category_id;}
public void setCategory_id(String category_id){this.category_id=category_id;}
public String getCategory(){return category;}
public void setCategory(String category){this.category=category;}
public String getPartner_id(){return partner_id;}
public void setPartner_id(String partner_id){this.partner_id=partner_id;}
public String getPartner_name(){return partner_name;}
public void setPartner_name(String partner_name){this.partner_name=partner_name;};
public String getAmount(){return amount;}
public void setAmount(String amount){this.amount=amount;};
public String getPayin_id(){return payin_id;}
public void setPayin_id(String payin_id){this.payin_id=payin_id;};
public String getPayin(){return payin;}
public void setPayin(String payin){this.payin=payin;};
public String getBalance(){return balance;}
public void setBalance(String balance){this.balance=balance;};
}
Я застрял здесь в течение длительного времени, пожалуйста, помогите мне решить эту проблему, пожалуйста.