android – Enviar una variable de un Activity a una Clase

tengo una app que estoy desarrollando y necesito enviar una variable desde mi activity al Repo de mi RecyclerView de tipo class, para usarlo en un whereEqualTo de Firebase. Necesito ayuda porque no consigo como lograrlo.

Este es el codigo de mi Repo de tipo class

package com.ezdev.chepesdelivery.ui.RecyMenu

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData

class RepoMenu {

    fun getTiendaData(): LiveData<MutableList<Plato>> {
        val mutableData = MutableLiveData<MutableList<Plato>>()
        FirebaseFirestore.getInstance().collection("Platos").whereEqualTo("tienda", "AquiVaMiVariable").get()
            .addOnSuccessListener { result ->
                mutableData.value = { snap ->
                            getString("plato") ?: "default",
                            getString("descripcion") ?: "default",
                            getBoolean("stock") ?: false,
                            getString("precio") ?: "default",

        return mutableData


La variable la usare para filtrar los elementos que necesito con el whereEqualTo.

Y este es mi activity

package com.ezdev.chepesdelivery

import android.os.Bundle
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import com.ezdev.chepesdelivery.ui.RecyMenu.MyAdapterMenu
import com.ezdev.chepesdelivery.ui.RecyMenu.MyViewModelMenu

class PedirActivity : AppCompatActivity(), MyAdapterMenu.OnTiendaListener {

    private lateinit var adapter: MyAdapterMenu
    private val viewModel by lazy { ViewModelProvider(this).get(}

    private val db = FirebaseFirestore.getInstance()

    override fun onCreate(savedInstanceState: Bundle?) {

        var nombreTienda = intent.getStringExtra("nombreTienda") //Este es la variable que necesito enviar
        var tiendaEmail = intent.getStringExtra("emailTienda")

        title = "Menu de $nombreTienda"

        adapter = MyAdapterMenu(this, this)

        recyclerViewMenu.layoutManager = LinearLayoutManager(this)
        recyclerViewMenu.adapter = adapter


    fun observeData(){
        viewModel.fetchTiendaData().observe(this, Observer {



    override fun onItemClick(nombre: String) {



La variable que necesito enviar es la que dice nombreTienda.

Bueno es seria todo, no se si tenga que compartir los demas codigos que estan en mi RecyclerView como mi Adapter o mi ViewModel, si es necesario para que me ayuden me dicen y los agrego.

android studio – How to stop a custom dialog fragment animation from repeating when activity is resumed?

The behavior I am talking about in the question can be seen in this video: There I am first showing the animations of my dialog and then the unwanted behavior that occurs when closing the app and then reopening it again.

Here is all the code that I used to implement these custom animations:


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="">
        android:toYDelta="0%p" />


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="">
        android:toYDelta="100%p" />

Then I created a style:

    <style name="DialogAnimation">
        <item name="android:windowEnterAnimation">@anim/dialog_show_anim</item>
        <item name="android:windowExitAnimation">@anim/dialog_dismiss_anim</item>

And finally in my dialog fragment’s onCreateView() method I wrote this:


What I’ve tried so far: I tried to interchange between the line above and this line


in my dialog class with flags that point out which one and when should be set, but a lot problems emerged mainly because setWindowAnimations() seemed to only work when placed in onCreateView(), onStart() or onResume().

I searched for a while but couldn’t find a solution anywhere. Can you help me fix this repeating of the animation when reopening the app or possibly point out another way to implement these animations without that problem ever occurring?

java – Back to previous activity from a fragment?

I have a pager adapter with three fragments, and i want to know how can i go back to the previous activity when im inside a fragment? i tried on back pressed but just close the app after click on back button.

Adapter :

public class PagerAdapter extends FragmentStateAdapter {

ArrayList<Fragment> arrayList = new ArrayList<>();

public PagerAdapter(@NonNull FragmentManager fragmentManager, @NonNull Lifecycle lifecycle) {
    super(fragmentManager, lifecycle);

public Fragment createFragment(int position) {
    Fragment fragment = new Fragment();
    switch (position){
        case 0: fragment = new VataFragment();
        case 1: fragment = new PittaFragment();
        case 2: fragment = new KhapaFragment();

    return fragment;

public int getItemCount() {
    return arrayList.size();

public void addFragment(Fragment fragment) {

Fragment 1 :

public class VataFragment extends Fragment {

public VataFragment() {
    // Required empty public constructor

public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.fragment_vata, container, false);

    // Inflate the layout for this fragment
    return view;


Please help me!! If we choose any activity in top menu bar category then slide below collection view in swipe right direction in swift 4 thanks

Evertime we Click on top menu and below collection same collection cell right slide how??

java – How to pass a list of objects from one activity to another using parcelable

I want to pass the list of itemselected or ItemsInCart to another activity. My Items Model implements parcelable. The problem is an getting error below in my PlaceOrder class.

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.recyclerview.widget.RecyclerView.setLayoutManager(androidx.recyclerview.widget.RecyclerView$LayoutManager)' on a null object reference at com.example.Project1.SecondActivity.onCreate(

Below is the code

Model Item;

public class Item implements Parcelable {
private int iid;
private String itenname;
private String itemprice;
private String itemstock;
private int totalInCart;
private List<Item> items;

public Item(int iid, String itenname, String itemprice, String itemstock, int totalInCart,List<Item> items) {
    this.iid = iid;
    this.itenname = itenname;
    this.itemprice = itemprice;
    this.itemstock = itemstock;
    this.totalInCart = totalInCart;
    this.items = items;

protected Item(Parcel in) {
    iid = in.readInt();
    itenname = in.readString();
    itemprice = in.readString();
    itemstock = in.readString();
    totalInCart = in.readInt();
    items = in.createTypedArrayList(Item.CREATOR);

public static final Creator<Item> CREATOR = new Creator<Item>() {
    public Item createFromParcel(Parcel in) {
        return new Item(in);

    public Item() newArray(int size) {
        return new Item(size);

public List<Item> getItems() {
    return items;

public void setItems(List<Item> items) {
    this.items = items;

public int getIid() {
    return iid;

public void setIid(int iid) {
    this.iid = iid;

public String getItenname() {
    return itenname;

public void setItenname(String itenname) {
    this.itenname = itenname;

public String getItemprice() {
    return itemprice;

public void setItemprice(String itemprice) {
    this.itemprice = itemprice;

public String getItemstock() {
    return itemstock;

public void setItemstock(String itemstock) {
    this.itemstock = itemstock;

public int getTotalInCart() {
    return totalInCart;

public void setTotalInCart(int totalInCart) {
    this.totalInCart = totalInCart;

public int describeContents() {
    return 0;

public void writeToParcel(Parcel dest, int flags) {


First Activity;
The list that i want to pass to second activity is ‘itemsInCart’

buttonCheckout.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            if (itemsInCart==null||itemsInCart.size()<=0){
                Toast.makeText(List_Items.this, "Please add some items to the cart.", Toast.LENGTH_SHORT).show();

           ArrayList<Item> additems = new ArrayList<Item>();
            for (int i = 0; i < itemsInCart.size(); i++){

            Intent intent = new Intent(MainActivity.this,DisplaySelectedItems.class);
            intent.putParcelableArrayListExtra ("Itemselected", additems);


Second Activity (in OnCreate method):

Bundle bundle = getIntent().getExtras();
    ArrayList<Item> selecteditems = bundle.getParcelableArrayList("Itemselected");

    CartItemsInRecyclerView.setLayoutManager(new LinearLayoutManager(this)); 
    placeOrderAdapter = new PlaceOrder_Adapter((ArrayList<Item>) items); <- This is line 59 of the error

I have found similar questions and tried their solutions but all is not working.
Please advise on what i have to change.

logging – Is it possible and how to log a website internal connection activity?

For instance, I have developed a WordPress website and prepared to deploy to client’s server. Since they request the site to be scanned in their VPN server first. For some reason, the application connects to many external resources and because the VPN is blocked the site from connecting to other location than its internal address, it is very slow. The slowness is believed to be due to blocking and retrial until giving up.

Since the application consists of a lot of plugins. What connection it is trying to make is not so obvious and straightforward.

Is it possible to track/log what the connection it is trying to made? If it is possible, I could do it in local server environment level and coding level to make a list of connection that it is trying to connect. And then I could use this list to discuss with the client and ask for white listing.

eg. normal connection log /user activity utility could log
user A with IP A visit > website.

But currently, if the site itself connect to

  • <<< possible log it down?
  • website B …
  • website C

Any hints, suggestions, insight is highly appreciated.
Thanks a lot.

Rootkit activity

If a hacker have installed remote access tool/rootkit on your computer, when they open site, where you’re logged in on your computer remotely, will their ip show up in that account activity? Or will it show up as your ip address?

I faced by Anomaly Activity on CPU usage on my server


I have several dedicated servers that run virtual servers normally.

[B]Recently, an important virtual server consumes a very la… | Read the rest of

Staff activity | NulledTeam UnderGround

Premium upgrade:

This XF2 add-on along with the entire collection can be purchased for $25.00 USD. Your Premium upgrade will allow you to download as many XF2 add-ons as you like for one year. Please see the entire collection located in the Resources area at this URL:

Note: all my XF1 add-ons are still 100% free and are supported by donations.


Shows activity of Administrative and Moderating user groups.

This add-on allows…


Monitor disk activity by process and by file in linux like windows ressource monitor

There are so many tools to monitor disk activity in linux like htop, dstat or iotop. However I didn’t find any way to monitor disk activity by process and by file. In windows ressource monitor does this job perfect.

enter image description here

I’m looking for a console tool to do the same in linux.