因此,出于某种原因,当我放入广告时,它不会自动填充广告:adSize和ads:adUnitId,我无法选择它们,而我的广告显示的文字显示缺少必需的XML属性"adSize".我也不认为我可以在我的布局中填写xmlns:ads,虽然我可能弄错了.为什么是这样?
我的渐变
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
第二个build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.example.matig.adtest"
minSdkVersion 15
targetSdkVersion 25 …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个随机生成的字符串.问题是,按照我设置的方式,它继续添加到自身.
我的代码(我从另一个类调用了很多静态变量,所以不要担心那部分)
class Generate1 extends Thread{
@Override
public void run() {
while(RUNNING == true){
generate();
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
private void generate(){
for(int i=0;i<length;i++){
int decider = rando.nextInt(6)+1;
if(decider == 1){
sb1.append("A");
}
if(decider == 2){
sb1.append("B");
}
if(decider == 3){
sb1.append("C");
}
if(decider == 4){
sb1.append("D");
}
if(decider == 5){
sb1.append("E");
}
if(decider == 6){
sb1.append("F");
}
}
Log.d("PSS",sb1.toString()); // this here is the stringbuilder being outputted
}
}
Run Code Online (Sandbox Code Playgroud)
如果我将长度设置为2,在我的日志中它看起来像:
DF …