我正试图在我的应用程序内打开Gallery内置应用程序中的图像/图片.
我有一张图片的URI(图片位于SD卡上).
你有什么建议吗?
我创建了一个带有方法的指令,该方法应该从不属于该指令的其他元素调用.但是看起来这个方法没有公开.
一些示例玉代码澄清:
//- a controller for the view itself
div(ng-controller="someController")
//- this is part of the view itself, not within the directive
div(ng-repeat="element in elements")
div(ng-click="methodFromDirective(element)") click element {{$index}} to trigger directive
//- this is the directive
div(some-directive)
Run Code Online (Sandbox Code Playgroud)
someController
我认为这不是太重要.它有方法但不是方法methodFromDirective(element)
.这methodFromDirective(element)
是一种仅存在于指令中的方法.
如果我制定一个指令并对创建进行一些记录,我可以清楚地看到它已创建.但是,该methodFromDirective(element)
方法未公开,因此未正确触发调用.
它methodFromDirective(element)
本身只适用于指令模板中的元素.
一些coffeescript显示指令的定义(忽略缩进错误):
'use strict'
define [], () ->
someDirective = () ->
restrict: 'A'
scope: {
show: '='
}
transclude: false
templateUrl: 'someTemplateHere.html'
controller = ($scope) ->
# exposing the method …
Run Code Online (Sandbox Code Playgroud) 我们遇到了一个项目的问题,该项目具有多个(2)产品风味尺寸和磨损模块.在构建一个版本时,我们没有编译错误,手机应用程序工作,但磨损应用程序永远不会同步观看.
手机应用模块build.gradle
包含(示例和仅提取)
flavorDimensions 'brand', 'type'
productFlavors {
nikon {
dimension 'brand'
}
canon {
dimension 'brand'
}
compact {
dimension 'type'
}
slr {
dimension 'type'
}
}
dependencies {
wearApp project(':wear')
}
Run Code Online (Sandbox Code Playgroud)
Wear app模块build.gradle
包含相同的尺寸配置
publishNonDefault true
flavorDimensions 'brand', 'type'
productFlavors {
nikon {
dimension 'brand'
}
canon {
dimension 'brand'
}
compact {
dimension 'type'
}
slr {
dimension 'type'
}
}
dependencies {
}
Run Code Online (Sandbox Code Playgroud)
我们检查了磨损应用程序是否在apk中通过安装在手机上并触发官方android穿戴应用程序的磨损应用程序同步选项.在日志记录中,您packageId
可以获得同步观察的s 的概述:
I/WearablePkgInstaller: Setting DataItem …
Run Code Online (Sandbox Code Playgroud) android build.gradle android-gradle-plugin android-productflavors wear-os
我有2个Android应用程序:
app1 - Activity11 --> Activity12 --> Activity13
app2 - Activity21 --> Activity22 --> Activity23
Run Code Online (Sandbox Code Playgroud)
我想从一个应用程序传递到另一个应用程序的第二个活动,传递一些数据.
app1 - Activity11 -->(switch to app2)--> Activity22 --> Activity23
Run Code Online (Sandbox Code Playgroud)
我要遵循哪些步骤?你知道一些教程吗?
我现在还没有编写代码,因为我不知道从哪里开始.
提前致谢.