小编yas*_*osi的帖子

找不到处理Intent的活动 - android.intent.action.OPEN_DOCUMENT

我正在尝试Android 4.4的存储访问框架

我开发了一个虚拟应用程序,它启动了活动开始的意图.

    Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
    intent.addCategory(Intent.CATEGORY_OPENABLE);
    startActivityForResult(intent, READ_REQUEST_CODE);
Run Code Online (Sandbox Code Playgroud)

我还开发了另一个虚拟应用程序作为文件提供程序.

        <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.saf"
    android:versionCode="1"
    android:versionName="1.0" >
<uses-sdk
    android:minSdkVersion="19"
    android:targetSdkVersion="19" />

<uses-permission android:name="android.permission.MANAGE_DOCUMENTS"/>

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.saf.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <provider
        android:name="com.example.saf.MyFileProvider"
        android:authorities="com.example.saf.documents"
        android:exported="@bool/is_kitkat"
        android:enabled="@bool/is_kitkat"
        android:grantUriPermissions="@bool/is_kitkat"
        android:permission="android.permission.MANAGE_DOCUMENTS">
        <intent-filter>
            <action android:name="android.content.action.DOCUMENTS_PROVIDER" />
        </intent-filter>
    </provider>

</application>
Run Code Online (Sandbox Code Playgroud)

我已经实现了MyFileProvider类.

但是当我启动用户应用程序(触发意图的那个)时,我收到以下错误

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.OPEN_DOCUMENT cat=[android.intent.category.OPENABLE] }
Run Code Online (Sandbox Code Playgroud)

我只是关注android的开发者文档.我有什么想法可能做错了吗?

编辑:这是我最新的Manifest.我还需要MyFileProvider"扩展DocumentsProvider"的"正确"实现吗?我现在可以在函数中返回null吗?

android android-intent android-activity android-4.4-kitkat storage-access-framework

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

WSO2 ESB无法将完整的JSON数据转换为XML

我正在建造一个POC.我为Google Plus创建了传递代理服务.没有使用任何代理服务我得到这是我的输出:

 {
   "kind":"plus#person",
   "etag":"\"ExituU7aUpmkkfyD52VulzptThw/4J1clegrhxYC2fsJOu2XWCs1Ewg\"",
   "id":"117488614303967062311",
   "displayName":"Abhi NeoN",
   "name":{
      "familyName":"NeoN",
      "givenName":"Abhi"
   },
   "tagline":"hey guys ! ssup!! check out ma recnt videos... uploaded",
   "gender":"male",
   "aboutMe":"\u003cb\u003ehie, abhishek - ma full name \u003c/b\u003e\u003cdiv\u003e\u003cb\u003em a DANCER ,\u003c/b\u003e\u003c/div\u003e\u003cdiv\u003e\u003cb\u003ei luv ma dancing .\u003c/b\u003e\u003c/div\u003e\u003cdiv\u003e\u003cb\u003ei care ma dancing ,\u003c/b\u003e\u003c/div\u003e\u003cdiv\u003e\u003cb\u003ei jus hv a gr8 thng in me dats ma dancing.\u003c/b\u003e\u003c/div\u003e",
   "relationshipStatus":"single",
   "url":"https://plus.google.com/117488614303967062311",
   "image":{
      "url":"https://lh6.googleusercontent.com/-tF-ip0tUxD4/AAAAAAAAAAI/AAAAAAAAAAA/WKI3USUh_DA/photo.jpg?sz=50"
   },
   "urls":[
      {
         "value":"https://plus.google.com/117488614303967062311",
         "type":"profile"
      },
      {
         "value":"https://www.googleapis.com/plus/v1/people/117488614303967062311",
         "type":"json"
      }
   ],
   "organizations":[
      {
         "name":"our lady of nazareth high school",
         "title":"science",
         "type":"school"
      },
      {
         "name":"",
         "title":"BLUEBYTES", …
Run Code Online (Sandbox Code Playgroud)

java xml json wso2 wso2esb

7
推荐指数
1
解决办法
6954
查看次数

使用Java的HTTP修补程序请求

我需要使用Java程序发送HTTP补丁请求。有人可以发布一个显示如何执行此操作的代码段吗?

java http

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

无法从包中获取意图过滤器

我想列出软件包中存在的所有意图过滤器。

我正在尝试使用PackageManager类。我在获取PackageInfo对象时设置了标志PackageManager.GET_INTENT_FILTERS。但是我不知道如何使用它。

我能够使用相应的标志获取与活动和接收者相关的所有信息,但是不知道如何进行意图过滤器。

任何想法如何解决这个问题?

android intentfilter android-intent android-package-managers

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

Why is Django logging not working with Gunicorn?

I have a django site with is behind a gunicorn server. Here are the logging settings for django -

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'verbose': {
            'format': '[%(asctime)s][%(levelname)s] %(message)s',
        },
    },
    'handlers': {
        'file': {
            'level': os.environ['DJANGO_LOGLEVEL'],
            'class': 'logging.FileHandler',
            'filename': '/mnt/storage/logs/django.log',
            'formatter': 'verbose',
        },
    },
    'loggers': {
        'django': {
            'handlers': ['file'],
            'level': os.environ['DJANGO_LOGLEVEL'],
            'propagate': True,
        },
    },
}
Run Code Online (Sandbox Code Playgroud)

Here is the command which starts gunicorn server -

gunicorn training_service.wsgi -b 0.0.0.0:8000 -w 4 --access-logfile /mnt/storage/logs/access.log --log-file …
Run Code Online (Sandbox Code Playgroud)

python django gunicorn

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

Google Calendar API 不适用于 curl 客户端请求

我正在尝试使用 curl 创建一个谷歌日历事件,这是我的请求,但它不起作用我不知道我犯了什么错误:

curl "https://www.googleapis.com/calendar/v3/calendars/{CalID}/events?access_token={access_token}" -H "Content-Type: application/json" -X POST -d '{ "end ": { "start": { "date": "2012-08-01", "dateTime": "2012-08-01 22:47:31.893205", "timeZone": "Asia/Calcutta" }, "end ": { "date": "2012-08-08", "dateTime": "2012-08-08 22:47:31.893205", "timeZone": "亚洲/加尔各答" }, "与会者": [ { " email": "dosi@iitpzx.com" }, { "email": "test@gmail.com" } ], "reminders": { "overrides": [ { "method": "email", "minutes": 10 } ] } }' -v

我不断收到错误请求错误。有人能告诉我这个请求有什么问题吗??

json curl google-calendar-api

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