Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set the text based on the position #168

Open
Chandrakala14 opened this issue Nov 11, 2019 · 0 comments
Open

How to set the text based on the position #168

Chandrakala14 opened this issue Nov 11, 2019 · 0 comments

Comments

@Chandrakala14
Copy link

HI,

I need to replace the card data based on the position,

Here I am able to get the position and unable to set the data based on the position

Below is my code :

 public InfoView(Context mContext, Info info, Activity activity) {
        mContext = mContext;
        mInfo = info;
        mActivity = activity;

    }


    @View(R.id.layout)
    public static LinearLayout layout;


    @Resolve
    private void onResolved() {

        Type.setText(mInfo.getType());
//        DispName.setText(mInfo.getDisplayName());
//        Source.setText(mInfo.getSource());
//        Destin.setText(mInfo.getDestination());
        JourneyDate.setText(String.valueOf(mInfo.getJourneydate()));
        Arrival_Time.setText(mInfo.getArrivalTime());
        Depttime.setText(mInfo.getDepartureTime());
        JourneyType.setText(String.valueOf(mInfo.getJourneyType()));
//        Duration.setText(mInfo.getDuration());
        Fare.setText(String.valueOf(mInfo.getNetFares()));
        Address.setText(mInfo.getAddress());
        Ratings.setText(mInfo.getRating());


        layout.setOnClickListener(new android.view.View.OnClickListener() {
            @Override
            public void onClick(android.view.View view) {

                Log.i("dataaa ", "Onclicked");
                Log.i("dataaa ", mInfo.getType());
                Log.i("dataaa ", mChildPosition + " test " + mParentPosition);
                String id = String.valueOf(mParentPosition + "" + mChildPosition);

                Toast.makeText(mActivity, id, Toast.LENGTH_SHORT).show();

                String type = mInfo.getType();

                try {
                    Intent intent = new Intent();
                    intent.getIntExtra("c1position", 0);
                } catch (Exception e) {
                    e.printStackTrace();
                }

Please help me to solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant