i need to get insert method which is exist in warehouse activity to another activity to insert object of warehouse entity i do'nt try to open WareHouseActivity just call insert method from activity in my activity to pass object of it
i use this two method but the problem doesn't solve i know why this methods are uncorrect but i put them for example
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_daily_movement);
WareHouseentity warehouseentity=new WareHouseentity();
method 1 ;;;;;;;;;;;;;
((WarehouseActivity)getApplicationContext).insert(warehouseentity);
method 2;;;;;;;;;;
WareHouseActivity warehouseactivity=new WareHouseActivity();
warehouseactivity.insert(warehouseentity)
}