#beginner는 ... 내가 만든 카드의 클릭 FRM 새로운 화면으로 이동하려면 목록보기 를 사용하여 카드 목록 here is the image을 생성 목록보기 ... 제발이 문제를 해결하는 데 도움이 .... 제발 내게 내 문제를 해결하기 위해 작업을 할 수있는 방법에 대한 자세한 내용을주세요 .... .... 여기에 내가 무엇입니까 부호화 ::::는
Main_Activity.java
package com.android.mezohn.nepstudy.app;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.android.mezohn.nepstudy.Adapter.subjectAdapter;
import com.android.mezohn.nepstudy.R;
import com.android.mezohn.nepstudy.model.ListDetails;
import com.android.mezohn.nepstudy.model.model;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
private ListView listView;
private ArrayList<model>models;
private subjectAdapter subjectAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
listView = (ListView)findViewById(R.id.list_view);
models = ListDetails.getList();
subjectAdapter = new subjectAdapter(MainActivity.this,models);
listView.setAdapter(subjectAdapter);
FloatingActionButton fab = (FloatingActionButton) 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();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.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);
}
}
,451,515,
model.java
package com.android.mezohn.nepstudy.model;
/**
* Created by ecspc on 25/10/2017.
*/
public class model {
private int subjectImage;
private String subjectTitle;
private String count;
public model(int subjectImage, String subjectTitle, String count) {
this.subjectImage = subjectImage;
this.subjectTitle = subjectTitle;
this.count = count;
}
public int getSubjectImage() {
return subjectImage;
}
public void setSubjectImage(int subjectImage) {
this.subjectImage = subjectImage;
}
public String getCount() {
return count;
}
public void setCount(String count) {
this.count = count;
}
public String getSubjectTitle() {
return subjectTitle;
}
public void setSubjectTitle(String subjectTitle) {
this.subjectTitle = subjectTitle;
}
}
subjectAdapter.java
package com.android.mezohn.nepstudy.Adapter;
import android.content.Context;
import android.graphics.ColorSpace;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.android.mezohn.nepstudy.R;
import com.android.mezohn.nepstudy.model.model;
import java.util.ArrayList;
/**
* Created by ecspc on 25/10/2017.
*/
public class subjectAdapter extends BaseAdapter {
private Context context;
private ArrayList<model> models;
public subjectAdapter(Context context, ArrayList<model> models) {
this.context = context;
this.models = models;
}
@Override
public int getCount() {
return models.size();
}
@Override
public Object getItem(int position) {
return models.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView ==null){
convertView = View.inflate(context, R.layout.list_view,null);
ImageView images = convertView.findViewById(R.id.cardImage);
TextView title = convertView.findViewById(R.id.cardTitle);
TextView count = convertView.findViewById(R.id.count);
model model = models.get(position);
images.setImageResource(model.getSubjectImage());
title.setText(model.getSubjectTitle());
count.setText(model.getCount());
}
return convertView;
}
}
ListDetails.java
package com.android.mezohn.nepstudy.model;
import com.android.mezohn.nepstudy.R;
import java.util.ArrayList;
/**
* Created by ecspc on 25/10/2017.
*/
public class ListDetails {
public static ArrayList<model> getList(){
ArrayList<model> subjectList = new ArrayList<>();
subjectList.add(new model(R.drawable.phy,"Physics","4 chapters available"));
subjectList.add(new model(R.drawable.che,"Chemistry","5 chapters available "));
subjectList.add(new model(R.drawable.que,"Model Questions","10 model Questions available"));
return subjectList;
}
}
,
나는 초보자이므로 충분한 도움을 얻을 수 있기를 바랍니다.
#beginner 주석 (및 beginner의 모든 언급)을 제거하고 질문에 아무 것도 추가하지 않습니다. 또한, 당신이 일어날 것으로 예상, 그리고 실제로 일어나는 무엇 –