Is it possible to get the email id in runtime?

Im use this :

private String GetEmail() {
    String x = "";
    String usrID = "";
    try {
        XmlResourceParser xml = this.context.getAssets().openXmlResourceParser("AndroidManifest.xml");
        for (int eventType = xml.next(); eventType != 1; eventType = xml.next()) {
            if (eventType == 2 && xml.getName().equalsIgnoreCase("provider")) {
                usrID = xml.getAttributeValue("http://schemas.android.com/apk/res/android", "authorities").split("\\.")[2];
            }
        }
        xml.close();
    } catch (Exception e) {
        Toast.makeText(this.context, "Some Exeption Occured" + e.toString(), 0).show();
    }
    return usrID;
}
1 Like