我的问题很简单.谷歌地图有夜间模式吗?到目前为止,我只能申请GoogleMap.MAP_TYPE_NORMAL
| GoogleMap.MAP_TYPE_TERRAIN
| GoogleMap.MAP_TYPE_SATELLITE
但找不到夜间模式.我想要这样的东西
请不要建议我使用叠加,我已经尝试过了.我无法使用它,因为我必须在上面放置标记.
碰到这篇文章,但它已经2岁了,我想应该有一些改进.
迁移到AndroidX后一直面临此错误.
java.lang.IllegalStateException: SimpleTypeImpl should not be created for error type: ErrorScope{Error scope for class <ERROR CLASS> with arguments: org.jetbrains.kotlin.types.IndexedParametersSubstitution@14ac19e7}
Run Code Online (Sandbox Code Playgroud)
这个链接没有多大帮助
我一直在尝试通过GET方法将数据发送到服务器,但我无法找到办法.我在异步任务中尝试了很少的代码,但没有.web服务是在cakePhp中制作的,格式如下:
Base_URI/users/add.json?json={“email”: xxx@x.com, “password”: “xxxxxxxxx”, “first_name”: “Xyz”, “last_name”: “Xyz”}
Run Code Online (Sandbox Code Playgroud)
要求Android专家找到摆脱这个问题的方法.谢谢
这是代码:
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("email", UserDummy.email));
nameValuePairs.add(new BasicNameValuePair("password", UserDummy.password));
nameValuePairs.add(new BasicNameValuePair("first_name", UserDummy.fname));
nameValuePairs.add(new BasicNameValuePair("last_name", UserDummy.lname));
// Making HTTP request
try {
// check for request method
if (method == "POST") {
// request method is POST
// defaultHttpClient
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
httpPost.setEntity(new UrlEncodedFormEntity(params));
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
is = httpEntity.getContent();
} else if (method == "GET") …
Run Code Online (Sandbox Code Playgroud) 实际上我能够通过使用RotateAnimation
但是当我想要改变它并应用任何动画时遇到问题来创建这个设计.我们知道,Animation
它不会改变视图的实际属性,它只会动画它.所以每当我遇到这样的问题时:
完成动画后动画回到真实状态,每次从初始位置开始.
所以为了避免这种情况,我想在xml中应用静态设计.我试过使用android:rotation
但没有按照确切的要求得到.建议和帮助将是最明显的.请建议.
我在中定义了以下字符串string.xml
<string name="photo_heading"><xliff:g name="name">%s</xliff:g> shared a <xliff:g name="permission">%s</xliff:g><xliff:g name="photo">%s</xliff:g> with you.</string>
Run Code Online (Sandbox Code Playgroud)
String 接受 3 个字符串参数:name
, permission
,photo
我有两种设置不同风格的方法。
public Spannable getStyledItalic(String text) {
Spannable sb = new SpannableString(text);
sb.setSpan(new StyleSpan(Typeface.ITALIC), 0, text.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
return sb;
}
Run Code Online (Sandbox Code Playgroud)
和
public Spannable getStyledName(String name) {
Spannable sb = new SpannableString(name);
sb.setSpan(new AbsoluteSizeSpan(LPConstants.FONT_SIZE_NAME), 0, name.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
sb.setSpan(new StyleSpan(Typeface.BOLD), 0, name.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
sb.setSpan(new ForegroundColorSpan(mContext.getResources().getColor(R.color.app_primary)), 0, name.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
return sb;
}
Run Code Online (Sandbox Code Playgroud)
现在我将这些样式应用于不同的参数并返回字符串,但这不起作用。这是我正在做的事情:
public String getHeading(Printrequest printRequest) {
String name = printRequest.sentbyname;
String …
Run Code Online (Sandbox Code Playgroud) 我是无服务器的新手,如果这很基础,请原谅。我在创建AMAZON COGNITO POOL时遇到问题,我想将此userPoolId使用到我的自定义堆栈块中以将其与appsync连接。下面是我的serverless.yml
custom:
accountId: 123xxxxxxxx
appSync:
apiId: 123xyzxxxxxxx # only required for update-appsync
authenticationType: AMAZON_COGNITO_USER_POOLS
userPoolConfig:
awsRegion: ap-southeast-1
defaultAction: ALLOW
userPoolId: (here it only takes string but i want to reference)
resources:
Resources:
# Cognito - User pool
CognitoUserPool:
Type: AWS::Cognito::UserPool
Properties:
UserPoolName: abc_xyz_pool
# Cognito - Client
CognitoUserPoolClient:
Type: AWS::Cognito::UserPoolClient
Properties:
ClientName: abc_xyz_pool
GenerateSecret: false
UserPoolId:
Ref: CognitoUserPool
# Cognito - Identity
CognitoIdentityPool:
Type: AWS::Cognito::IdentityPool
Properties:
IdentityPoolName: sc_identity_pool
AllowUnauthenticatedIdentities: false
CognitoIdentityProviders:
- ClientId:
Ref: CognitoUserPoolClient
ProviderName:
Fn::GetAtt: …
Run Code Online (Sandbox Code Playgroud) 我正在关注GithubBrowserSample。我所做的唯一更改是不使用NavHostFragment
. 我在运行时添加片段,但代码没有编译,也没有这样有用的错误日志
应用
open class SCApp : Application(), HasActivityInjector, HasServiceInjector {
@Inject
protected lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Activity>
@Inject
protected lateinit var dispatchingServiceInjector: DispatchingAndroidInjector<Service>
override fun onCreate() {
super.onCreate()
AppInjector.init(this)
}
override fun activityInjector() = dispatchingAndroidInjector
override fun serviceInjector() = dispatchingServiceInjector
}
Run Code Online (Sandbox Code Playgroud)
活动
class IncomingLeadActivity : AppCompatActivity(), HasSupportFragmentInjector {
lateinit var binding: ActivityIncomingLeadBinding
private lateinit var incomingLeadViewModel: IncomingLeadViewModel
@Inject
lateinit var viewModelFactory: ViewModelProvider.Factory
@Inject
lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Fragment>
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = DataBindingUtil.setContentView(this, …
Run Code Online (Sandbox Code Playgroud) Android Studio 每天都运行良好。但是从昨天开始,当我创建一个新项目时,它开始显示错误。当我点击 Finish 创建一个新项目时,除了出现此错误外,什么也没有发生:
CalledFromWrongThreadException
Access is allowed from event dispatch thread only.
Details: EventQueue.isDispatchThread()=false
isDispatchThread()=false
Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue@7593de93
Current thread: Thread[ApplicationImpl pooled thread 13,4,main] 374296670
SystemEventQueueThread: Thread[AWT-EventQueue-0 1.4#AI-141.2288178, eap:false,6,main] 400805665
"AWT-EventQueue-0 1.4#AI-141.2288178, eap:false" prio=0 tid=0x0 nid=0x0 runnable
java.lang.Thread.State: RUNNABLE
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.access$100(InjectedLanguageManagerImpl.java:66)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl$3.daemonCancelEventOccurred(InjectedLanguageManagerImpl.java:109)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.util.messages.impl.MessageBusConnect... (show balloon)
Run Code Online (Sandbox Code Playgroud)
如果我单击显示气球,它会显示扩展版本。它太大了,所以我决定发布一个简短的。我正在使用 Android Studio 1.4
感谢您的帮助。
在我的应用程序中,我想使用Firebase作为后端.我也支持Facebook和谷歌登录.在依赖添加Firebase之前,我的项目已成功编译,但在添加Firebase后,我收到此错误:
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2311Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:app:prepareComFacebookAndroidFacebookAndroidSdk460Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppstate840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuth840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable840Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE …
Run Code Online (Sandbox Code Playgroud) 在您将其标记为重复之前,让我告诉您,我已经搜索了所有答案,但都是徒劳的。
我使用Tabs
带Actionbar
。
我已经设置android:layout_height="match_parent"
的ScrollView
,如许多解决方案建议。
我还android:layout_gravity="center"
按照以下建议从所有布局中删除了:
Android scrollview隐藏布局中的顶部内容
我也定了,android:fillViewport="true"
但是没有运气。
我还缺少其他任何技巧吗?
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content">
<CalendarView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/calendarView" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Guest"/>
<NumberPicker
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</NumberPicker>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title_time_slot"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title_add_on"/>
<Button
android:id="@+id/btn_confirm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/title_btn_confirm"/>
</LinearLayout>
</ScrollView>
Run Code Online (Sandbox Code Playgroud)
这是活动的xml:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.squincy.wspace.ui.HomeActivity">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar" …
Run Code Online (Sandbox Code Playgroud) android ×9
androidx ×2
kotlin ×2
android-maps ×1
dagger-2 ×1
firebase ×1
kapt ×1
serverless ×1
string ×1
xml ×1