Pregunta

Is there a way to get android context inside custom ACRA ReportSender implementation class?

public class MyReportSender implements ReportSender {
    public ErrorReportSender(){}
}
¿Fue útil?

Solución

You can save reference to object of your Application implementation into the static variable and get it using static method:

    private static Application sInstance;

@Override
public void onCreate ()
{
    sInstance = this;
    ACRA.init( this );
    super.onCreate();
}
public static Application getInstance()
{
  return sInstance;
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top