相关疑难解决方法(0)

在服务中发送电子邮件(不提示用户)

是否有可能我使用服务在后台发送电子邮件..就像在服务中我使用Intent与ACTION_SENDTO与Uri数据mailto:recipient_email并且它在后台发送而无需任何用户干预..或通过默认电子邮件应用程序而不提示用户. ..

email service android android-intent

5
推荐指数
1
解决办法
1万
查看次数

当我们打开手机并注册时,如何获取第一个Gmail帐户详细信息

我有以下代码获取与我的手机同步的所有gmail ID,但我想要用户第一次注册的主gmail ID.因为所有其他gmail帐户(不是主要的)如果我想我可以随时删除但删除主帐户我们也必须做其他事情,所以这就是为什么我想让主要帐户用于我的应用程序.

这是我的代码,我想在其中添加一些过滤器,我可以做到这一点,但无法正确得到这个东西.

Account[] accounts=AccountManager.get(this).getAccountsByType("com.google");
    for(Account account: accounts)
    {
        String possibleEmail=account.name;
        Log.d("Possible email id's of user", possibleEmail);
    }
Run Code Online (Sandbox Code Playgroud)

我已经看过罗马链接,但无法以正确的方式转换它.我想使用这个主要的电子邮件ID来使用谷歌的C2DM进行推送通知.

android accountmanager

2
推荐指数
1
解决办法
4456
查看次数

如何在Android设备上获取用户个人资料

我希望能够自动将信息输入到创建帐户表单中,并根据用户已输入设备的信息(如姓名,电子邮件地址,电话号码)建议可能性.我需要一种与API级别8兼容的方法.

android google-account contactscontract accountmanager android-contacts

2
推荐指数
1
解决办法
1万
查看次数

使用CursorLoader获取所有者的电子邮件地址

我正在尝试用所有者的电子邮件填充ArrayList.我是在一个片段中这样做的.这是我的代码:

 public class ItemDetailFragment extends Fragment implements
        LoaderManager.LoaderCallbacks<Cursor> {

    ArrayList<String> emails = new ArrayList<String>();

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        getLoaderManager().initLoader(0, null, this);

    }


        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
                View myFragmentView = inflater.inflate(R.layout.formal_email_layout,
                                container, false);
                return myFragmentView;
       }


 public Loader<Cursor> onCreateLoader(int id, Bundle arguments) {
            return new CursorLoader(getActivity(),
                    // Retrieve data rows for the device user's 'profile' contact.
                    Uri.withAppendedPath(
                            ContactsContract.Profile.CONTENT_URI,
                            ContactsContract.Contacts.Data.CONTENT_DIRECTORY),
                    ProfileQuery.PROJECTION,

                    // Select only email addresses.
                    ContactsContract.Contacts.Data.MIMETYPE + " = ?",
                    new String[]{ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE}, …
Run Code Online (Sandbox Code Playgroud)

email android android-contacts android-cursorloader

0
推荐指数
1
解决办法
1622
查看次数