我想知道这个按钮调用的方法.

我的游戏总是暂停/继续正常除当我使用这个按钮,它看起来像这个按钮不会调用onPause()和onResume()一个方法活动.它可以工作,如果我退出游戏,转到另一个窗口(如图片中的那个),然后使用此按钮恢复.但是,如果我只是按下这个按钮,当游戏时,游戏暂停,但线程dosnt恢复就像它每隔一段时间一样,游戏类型只是停留在屏幕上并且有点闪烁.
很难解释,但我希望我有点清楚,如果没有,请问!
user-interface android button android-3.0-honeycomb android-4.0-ice-cream-sandwich
当我尝试使用GAE在我的Google网络应用程序项目中运行自动生成的代码时,出现以下错误:
Mar 19, 2014 5:21:28 PM com.google.appengine.tools.development.agent.AppEngineDevAgent premain
SEVERE: Unable to load the App Engine dev agent. Security restrictions will not be completely emulated.
java.lang.RuntimeException: Unexpected exception during cast.
at com.google.apphosting.utils.clearcast.ClearCast$CasterImpl.cast(ClearCast.java:385)
at com.google.apphosting.utils.clearcast.ClearCast.staticCast(ClearCast.java:252)
at com.google.apphosting.utils.clearcast.ClearCast.staticCast(ClearCast.java:263)
at com.google.appengine.tools.development.agent.AppEngineDevAgent.premain(AppEngineDevAgent.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown Source)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown Source)
Caused by: java.lang.IllegalAccessException: Class com.google.apphosting.utils.clearcast.ClearCast$CasterImpl can not access a member of class com.google.appengine.tools.development.agent.$Proxy0 with modifiers "public"
at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(Unknown Source)
at java.lang.reflect.AccessibleObject.checkAccess(Unknown Source) …Run Code Online (Sandbox Code Playgroud) 我试图弄清楚如何授权使用Azure Active Directory B2C中的组.我可以通过用户授权,例如:
[Authorize(Users="Bill")]
Run Code Online (Sandbox Code Playgroud)
然而,这不是很有效,我看到很少用例.另一种解决方案是通过角色授权.但是由于某些原因,似乎并没有wowrk.例如,如果我为用户提供"全局管理员"角色,请尝试:
[Authorize(Roles="Global Admin")]
Run Code Online (Sandbox Code Playgroud)
这是行不通的.有没有办法通过群组或角色进行授权?
关于Stack上类似问题的信息,我最终得到以下信息:
数据库:
{
"user" : {
"xbStJyCtfzf472" : {
"avatar" : "avatar",
"email" : "email@gmail.com",
"fbId" : 10154200898,
"lastLogin" : "Tue Mar 14 22:31:36 GMT+01:00 2017",
"registerDate" : "Tue Mar 14 22:31:36 GMT+01:00 2017",
"uid" : "xbStJyCwY5Ttfzf472",
"username" : "myName"
}
},
"usernames" : {
"myName" : "xbStJyCtfzf472"
}
}
Run Code Online (Sandbox Code Playgroud)
规则:
{
"rules": {
".read": "auth != null",
".write": "auth != null",
"users": {
"$uid": {
".write": "auth !== null && auth.uid === $uid",
".read": "auth !== null && auth.provider …Run Code Online (Sandbox Code Playgroud) 我有一个看起来像这样的对象:
{
"id": 1,
"name": "Customer",
"parks": {
"1": "Park a",
"23": "Park b",
"7": "Park c",
"83": "Park d"
},
"users": {
"11": "user@customer.com"
}
}
Run Code Online (Sandbox Code Playgroud)
在左侧的价值parks和users不是指数,但实际id的公园.如何在Javascript中访问此值?
目前我使用的是Vue.Js,所以我将这样的值绑定到一个组件:
<park-component v-for="park in customer.parks"
v-bind:prop="park"
v-bind:key="park.id">
</park-component>
Run Code Online (Sandbox Code Playgroud)
然而,这仅限于右侧的公园值,即名称"park a".我也需要能够访问左侧.如果不能通过html中的Vue实现,可以在脚本中完成吗?即如果我有:
"23": "park b"
我该怎么23办?
我想从我的Vue实例更新组件中的数据.找到关于如何做相反事情的大量例子,但没有任何内容.
说我有:
Vue.component('component', {
props: {
prop: {
default: null
}
},
template: '#template',
data: function () {
return {
open: false
};
}
});
Run Code Online (Sandbox Code Playgroud)
现在,我想设置open到true从我的Vue的实例:
var root = new Vue({
el: '#root',
data: {},
methods: { updateComponentData: function() {//set open to true} } });
Run Code Online (Sandbox Code Playgroud) 我想禁用我的提交按钮,直到我的表单填写正确,这是我到目前为止:
<form>
<input type="text" class="form-control" v-validate="'required|email'" name="email" placeholder="Email" v-model="userCreate.userPrincipalName" />
<span v-show="errors.has('email')">{{ errors.first('email') }}</span>
<button v-if="errors.any()" disabled="disabled" class="btn btn-primary" v-on:click="sendInvite();" data-dismiss="modal" type="submit">Send Invite</button>
<button v-else="errors.any()" class="btn btn-primary" v-on:click="sendInvite();" data-dismiss="modal" type="submit">Send Invite</button>
</form>
Run Code Online (Sandbox Code Playgroud)
在我开始输入值之后,上面只打印错误消息并禁用我的提交按钮.在开始与输入交互之前,我需要从一开始就禁用它,这样我就不能发送空字符串了.
另一个问题是,是否有比使用更好的方法v-if?
编辑:
userCreate: {
customerId: null,
userPrincipalName: '',
name: 'unknown',
isAdmin: false,
isGlobalAdmin: false,
parkIds: []
}
Run Code Online (Sandbox Code Playgroud) 我有一个可以完美发布数据的POST方法。
查看文档,似乎 PATCH(或 PUT)应该看起来完全相同,只需使用PutAsync而不是PostAsync.
做得好,我收到以下错误:
+ postResponse {StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.NoWriteNoSeekStreamContent, Headers:
{
Cache-Control: private
Date: Mon, 09 Oct 2017 12:19:28 GMT
Transfer-Encoding: chunked
request-id: 60370069-f7c4-421d-842e-b1ee8573c2c2
client-request-id: 60370069-f7c4-421d-842e-b1ee8573c2c2
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"North Europe","Slice":"SliceB","ScaleUnit":"002","Host":"AGSFE_IN_7","ADSiteName":"DUB"}}
Duration: 3.2626
Content-Type: application/json
}} System.Net.Http.HttpResponseMessage
Run Code Online (Sandbox Code Playgroud)
和回应:
实体仅允许使用 JSON Content-Type 标头写入
果然在错误中我也可以看到:
ContentType {text/plain; charset=utf-8} System.Net.Http.Headers.MediaTypeHeaderValue
Run Code Online (Sandbox Code Playgroud)
所以这个错误是有道理的,但是,我确实告诉它使用 JSON,它在我的 POST 方法中按预期工作,使用相同的代码:
public async Task UpdateToGraph(object UnSerializedContent, string relativeUrl)
{
string accessToken = await _tokenManager.GetAccessTokenAsync();
HttpContent content = new StringContent(JsonConvert.SerializeObject(UnSerializedContent));
Client.DefaultRequestHeaders.Authorization = …Run Code Online (Sandbox Code Playgroud) 在Azure门户内部,我将App Service Authentication设置为"On"对于我的Web App,我使用AAD作为身份验证提供程序.
到目前为止,这已经很好用,我需要一个允许匿名用户的端点,但是该属性[AllowAnonymous]不起作用,我仍然需要登录.
码:
[Authorize]
[RoutePrefix("users")]
public class UsersController : Controller
{
[Route("register/{skypeid}")]
public ActionResult Register(string skypeid)
{
///stuff...
}
catch (Exception ex)
{
return Content(ex + "");
}
ViewBag.Name = name;
return View();
}
[AllowAnonymous]
[Route("exists/{skypeid}")]
public ActionResult Exists(string skypeid)
{
return Content("Hello " + skypeid);
}
Run Code Online (Sandbox Code Playgroud)
我认为代码是正确的,它是否与我的Web App使用App Service Authentication这一事实有关?
编辑:所以,我发现问题的根源,在Azure中,如果您将"未经过身份验证时采取的操作"设置为"使用Azure Active Directory登录",它绝不会允许匿名.
但是,如果我将其更改为允许匿名,则在尝试使用[Authorize] -Attribute访问控件时不会提示用户登录,它只是告诉我"您无权查看此目录或页面".这是有意的吗?这看起来很奇怪.如果有[Authorize] -Attribute,我希望用户被重定向到Login.
屏幕截图清晰:
在尝试为我的In-App-Product添加评论信息时,我上传了一个1280x800的截图(成功),没有alpha.然后我点击"保存",它告诉我"你必须上传一个有效的截图",就是这样,没有给出进一步的信息.据我所知,我的截图是有效的.
我试过firefox和safari.
asp.net-mvc ×3
vue.js ×3
android ×2
azure ×2
vuejs2 ×2
android-4.0-ice-cream-sandwich ×1
azure-ad-b2c ×1
button ×1
c# ×1
eclipse ×1
firebase ×1
http-headers ×1
ios ×1
javascript ×1
vee-validate ×1