Кнопка Instagram для профиля пользователя в Android Studio - PullRequest
1 голос
/ 04 мая 2020

В настоящее время у меня есть список намерений в профиле соответствующего пользователя. Я хотел бы добавить в Instagram кнопку lo go, которая ведет к приложению instagram пользователя в их телефоне. Я нашел глиф Instagram lo go и добавил его в свой профиль, но не уверен, как связать ссылку каждого пользователя с массивом.

Вот моя активность,

    package android.com.example.weddingappfinale;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.inputmethod.EditorInfo;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.SearchView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;

import Adapters.MuaAdapter;
import CustomerActivities.MuaCustomerActivity;

public class MuaActivity extends AppCompatActivity {

    private RecyclerView mRecyclerView;
    private MuaAdapter mAdapter;
    private RecyclerView.LayoutManager mLayoutManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.mua_list);

        getSupportActionBar().setTitle("Make Up Artists");
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        final ArrayList<MuaView> muaView = new ArrayList<>();
        muaView.add(new MuaView(R.drawable.mua_image, "Shima Matin Bridal", "Shima Matin started in 2012","Bridal Makeup","",R.drawable.gift_image,"81806627","36 Marsiling Drive #13-407 Block A"));
        muaView.add(new MuaView(R.drawable.photography_image, "ABCD Pte Ltd", "ABCD Pte Ltd founded in 2019, a new kid in the block","Bridal Clothes","Bridal Accessories",R.drawable.gift_image,"98262806","684A Choa Chua Kang Crescent #06-310"));
        muaView.add(new MuaView(R.drawable.placeholder,"Wooha Pte Ltd","Started in 2010","Bridal Makeup","Bridal Clothes",R.drawable.gift_image,"91923182","Singapore 73923"));


        // ArrayList

        mRecyclerView = findViewById(R.id.recycler_view_list);
        mRecyclerView.setHasFixedSize(true);
        mLayoutManager = new LinearLayoutManager(this);
        mAdapter = new MuaAdapter(muaView);

        mRecyclerView.setLayoutManager(mLayoutManager);
        mRecyclerView.setAdapter(mAdapter);

        // Item Click listener for CardView and Parcel CardView to new Intent

        mAdapter.setOnItemClickListener(new MuaAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(int position) {
                Intent intent = new Intent(MuaActivity.this, MuaCustomerActivity.class);
                intent.putExtra("Customer's Details", muaView.get(position));
                startActivity(intent);
            }

        });

    }

    // Filter/Search Bar

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.search, menu);

        MenuItem searchItem = menu.findItem(R.id.action_search);
        SearchView searchView = (SearchView) searchItem.getActionView();

        searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);

        searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
            @Override
            public boolean onQueryTextSubmit(String query) {
                return false;
            }

            @Override
            public boolean onQueryTextChange(String newText) {
                mAdapter.getFilter().filter(newText);
                return false;
            }
        });
        return true;
    }
}
...