I am getting the following error on Shopping.this
:
non-static variable this cannot be referenced from a static context.
How should I change my code besides changing getShipping()
to non-static?
public class Shopping extends Activity {
public static final String total_weights = "weight";
public static double getShipping(double total_weight) {
String weight = Double.toString(total_weight);
System.out.println(weight);
Intent intent = new Intent(Shopping.this,shopping1.class);
intent.putExtra(total_weights, weight);
Shopping.this.startActivity(intent);
}
}