小编Gri*_*ani的帖子

如何从电话簿获取与android中特定联系人链接的所有社交帐户?

我从电话簿中获取了所有设备联系人.现在我想从电话簿中获取的特定联系人获取链接帐户(facebook,twitter,instagram,LinkedIn).我该怎么办?

这是获取联系人的代码.

public Cursor getContactsCursor(FragmentActivity activity) {
        Cursor cursor = null;
        try {
            String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + "= 0" + " OR " + ContactsContract.Contacts.IN_VISIBLE_GROUP + "= 1";
            String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + " COLLATE LOCALIZED ASC";
            ContentResolver cr = activity.getContentResolver();
            return cr.query(ContactsContract.Contacts.CONTENT_URI, null, selection, null, sortOrder);
        } catch (Exception e) {
            AppLogger.e(Helper.class.getSimpleName(), e.getMessage());
            return cursor;
        }
    }
Run Code Online (Sandbox Code Playgroud)

现在我不知道如何获取与特定联系人链接的帐户(如facebook,linkedin等).

有人可以指导我.

更新: 在下面附加的图像中,单击红色突出显示的部分,在浏览器中打开链接的用户配置文件.因此,我愿意获取用于打开用户个人资料页面的字段.

在此输入图像描述

提前致谢.

twitter android facebook linkedin android-contacts

6
推荐指数
1
解决办法
542
查看次数

登录名不匹配。请为此身份或身份池包含至少一个有效登录名

我正在尝试将登录凭据(例如 auth0 登录的访问令牌)放入 amazon cognito,然后尝试在我的应用程序中上传个人资料图片。我从亚马逊收到错误,如:

Logins don't match. Please include at least one valid login for this identity or identity pool. (Service: AmazonCognitoIdentity; Status Code: 400; Error Code: NotAuthorizedException; Request ID: 0fafe672-2863-11e9-8f0e-cdc8b612afa1)
Run Code Online (Sandbox Code Playgroud)

上传图片任务.java

private class UploadImageTask extends AsyncTask<Void, Demo, Demo> {
        final ConditionVariable conditionVariable = new ConditionVariable(false);
        Demo demo = new Demo();
        File compressImage;
        private User user;

        UploadImageTask(User user) {
            this.user = user;
        }

        @Override
        protected Demo doInBackground(Void... params) {
            compressImage = new File(compressImage(user.getProfileUrl()));
            String uniqueId = UUID.randomUUID().toString();
            final String …
Run Code Online (Sandbox Code Playgroud)

android amazon-s3 amazon-web-services amazon-cognito

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

MpAndroidChart Piechart图例在底部中心切割问题

我附上了我的使用图表的截图。在红色框中显示图例,它们在饼图中切割。 下面是我的代码:

pieChart.setUsePercentValues(false);
pieChart.getDescription().setEnabled(false);
pieChart.setDragDecelerationFrictionCoef(0.95f);
pieChart.setDrawHoleEnabled(true);
pieChart.setHoleColor(Color.WHITE);
pieChart.setTransparentCircleColor(Color.WHITE);
pieChart.setTransparentCircleAlpha(110);
pieChart.setHoleRadius(55f);
pieChart.setTransparentCircleRadius(57f);
pieChart.setDrawCenterText(true);
pieChart.setRotationAngle(0);
// enable rotation of the chart by touch
pieChart.setRotationEnabled(true);
pieChart.setHighlightPerTapEnabled(true);
// add a selection listener
pieChart.setOnChartValueSelectedListener(this);
pieChart.animateY(1400, Easing.EasingOption.EaseInOutQuad);

Legend l = pieChart.getLegend();
l.setVerticalAlignment(Legend.LegendVerticalAlignment.BOTTOM);
l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER);
l.setOrientation(Legend.LegendOrientation.VERTICAL);
l.setDrawInside(false);
l.setForm(Legend.LegendForm.CIRCLE);
l.setXEntrySpace(7f);
l.setYEntrySpace(0f);
l.setYOffset(0f);
l.setWordWrapEnabled(true);
l.setDrawInside(false);
l.getCalculatedLineSizes();

// entry label styling
pieChart.setEntryLabelColor(Color.WHITE);
pieChart.setEntryLabelTextSize(12f);
Run Code Online (Sandbox Code Playgroud)

有谁知道答案吗?请帮我解决这个问题。提前致谢。

在此处输入图片说明

更新:

下面是我用来显示图表的 xml 文件。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/AppTheme"
tools:context="com.visualogyx.app.activity.SettingsActivity$PlaceholderFragment">

<RelativeLayout
    android:id="@+id/linear_change_usage"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="16dp"
    android:orientation="vertical">

    <RelativeLayout
        android:id="@+id/relative_text_dropdown_arraow"
        android:layout_width="match_parent" …
Run Code Online (Sandbox Code Playgroud)

android mpandroidchart

4
推荐指数
1
解决办法
2273
查看次数