如果我以这种方式在textview中设置文本,这不是问题:
tv.setText("" + ANS[i]);
Run Code Online (Sandbox Code Playgroud)
这简直就是这样.
String a = tv.getText().toString();
int A = Integer.parseInt(a);
Run Code Online (Sandbox Code Playgroud)
但是在textView中设置值的情况下.
tv1.setText(" " + X[i] + "\n" + "+" + " " + Y[i]);
Run Code Online (Sandbox Code Playgroud)
这是这样的
5
+9
Run Code Online (Sandbox Code Playgroud)
我有问题,这个值怎么弄.
我不知道这里发生了什么,但我试图通过下面的代码动态设置我的广告单元ID,并将其从XML中删除但仍然得到错误:
必须在调用loadAd之前设置广告尺寸和广告单元ID.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="SMART_BANNER">
</com.google.android.gms.ads.AdView>
Run Code Online (Sandbox Code Playgroud)
和
AdView mAdView = (AdView) rootView.findViewById(R.id.adView);
mAdView.setAdUnitId(getEvent().getAdMobUnitId());
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
Run Code Online (Sandbox Code Playgroud) 我尝试在eclipse上运行我的应用程序,但我发现了这些错误.这是第一次面临的,所以请你给我任何关于这些错误的想法.我目前正在使用Nexus mobile.
[2011-08-04 15:59:09 - App] Android Launch!
[2011-08-04 15:59:09 - App] adb is running normally.
[2011-08-04 15:59:09 - App] Performing com.horror.android.AppActivity activity launch
[2011-08-04 15:59:09 - App] Automatic Target Mode: using device 'HT9CRP800333'
[2011-08-04 15:59:09 - App] Uploading Test.apk onto device 'HT9CRP800333'
[2011-08-04 15:59:09 - App] Failed to install Test.apk on device 'HT9CRP800333': Unable to open sync connection!
[2011-08-04 15:59:09 - App] java.io.IOException: Unable to open sync connection!
[2011-08-04 15:59:09 - App] Launch canceled!
Run Code Online (Sandbox Code Playgroud)
为什么我得到java.io.IOException:无法打开同步连接!.提前致谢.
我正在尝试创建一种类型的多个对象.然后我想将这些值传输到数组列表中.如何使用具有不同名称的while循环创建对象.例如,这里是我的代码,但它只会生成一个名称的对象.
Customer cust = new Customer("bob", 20.0);
Run Code Online (Sandbox Code Playgroud)
和我的构造函数,如果你想看到:
public Customer(String customerName, double amount)
{
String name=customerName;
double sale=amount;
}
Run Code Online (Sandbox Code Playgroud)
StoreTest类(使用main方法):
import java.util.ArrayList;
import java.util.Scanner;
public class StoreTest {
ArrayList<Customer> store = new ArrayList<Customer>();
public static void main (String[] args)
{
double sale=1.0; //so the loop goes the first time
//switch to dowhile
Scanner input = new Scanner(System.in);
System.out.println("If at anytime you wish to exit" +
", please press 0 when asked to give " +
"sale amount.");
while(sale!=0)
{ …Run Code Online (Sandbox Code Playgroud) 我必须在标题页标题中显示带有相应图标的标题.喜欢这个图像.但只能显示标题而不是图标.
这是我所做的代码.
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
// Return a DummySectionFragment (defined as a static inner class
// below) with the page number as its lone argument.
Log.e("POSITION", "position=" + position);
Fragment fragment;
switch (position) {
case 0:
//Fragment1
case 1:
//Fragment2
case 2:
//Fragment3
case 3:
//Fragment4
case 4:
//Fragment5
}
return null;
} …Run Code Online (Sandbox Code Playgroud) 我将开发足球应用程序,并跟随json响应.(链接)
我有两个不同的类,具有不同的名称,但具有相同的属性或字段,并希望显示一个相同的单一RecyclerView.
在这里,我有worldmatch和世界具有类似于相同的字段matchTime,startTime以及endTime.我使用jsontopojo插件创建了pojo类.
这是主要的事情,我想显示worldmatch在0位置,并根据俱乐部的其他位置世界其他地区.您可以在图片中查看更多详细信息.
这必须是第一个标签(世界),类似于欧洲,亚洲等具有相似模式的其他标签.
TAB1(世界)
---------------position 0 (All match)------------------
|
| 930 1100 1130 and so on ( horizontal recyclerview)
|
-------------------------------------------
---------------position 1(Barcelona)------------------
|
| 1130 1230 1330 1430 and so on ( horizontal recyclerview)
|
-------------------------------------------
---------------position 2(Chelsea)------------------
|
| 1300 1400 1500 and so on ( horizontal recyclerview)
|
-------------------------------------------
.
.
.
so on
(vertical …Run Code Online (Sandbox Code Playgroud) [2011-07-22 16:33:02 - Today] ------------------------------
[2011-07-22 16:33:02 - Today] Android Launch!
[2011-07-22 16:33:02 - Today] adb is running normally.
[2011-07-22 16:33:02 - Today] Performing com.horror.android.today.myMain activity launch
[2011-07-22 16:33:02 - Today] Automatic Target Mode: launching new emulator with compatible AVD 'google09'
[2011-07-22 16:33:02 - Today] Launching a new emulator with Virtual Device 'google09'
[2011-07-22 16:33:10 - Today] New emulator found: emulator-5554
[2011-07-22 16:33:10 - Today] Waiting for HOME ('android.process.acore') to be launched...
[2011-07-22 16:34:07 - Today] HOME is up on …Run Code Online (Sandbox Code Playgroud) 由于运行不同的应用程序,我的计算机变慢,然后从窗口任务管理器中删除一些进程.不幸的是,在这个时候adb.exe也被删除了.我尝试重新启动eclipse并重新连接我的手机到USB端口,但无法正常工作.只剩下重启我的电脑,所以如何解决这个问题.
[2011-10-12 15:09:00 - Ultimate Jokes] ------------------------------
[2011-10-12 15:09:00 - Ultimate Jokes] Android Launch!
[2011-10-12 15:09:00 - Ultimate Jokes] Connection with adb was interrupted, and attempts to reconnect have failed.
[2011-10-12 15:09:00 - Ultimate Jokes] 5 attempts have been made to restart adb.
[2011-10-12 15:09:00 - Ultimate Jokes] You may want to manually restart adb from the Devices view.
Run Code Online (Sandbox Code Playgroud) 我在kotlin测试中使用spek非常新.使用spek时,在logcat上出现以下错误.我不知道为什么我得到这个
java.lang.ClassNotFoundException: com.intellij.junit5.JUnit5IdeaTestRunner
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.intellij.rt.execution.junit.JUnitStarter.getAgentClass(JUnitStarter.java:252)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMainV2.main(AppMainV2.java:131)
Run Code Online (Sandbox Code Playgroud)
我对gradle文件有以下依赖关系
testImplementation 'junit:junit:4.12'
testImplementation 'org.jetbrains.spek:spek-api:1.1.0-beta3'
testImplementation 'org.jetbrains.spek:spek-junit-platform-engine:1.1.0-beta3'
testImplementation 'org.junit.platform:junit-platform-runner:1.0.0-M3'
Run Code Online (Sandbox Code Playgroud)
测试文件
import org.jetbrains.spek.api.Spek
import org.jetbrains.spek.api.dsl.given
import org.jetbrains.spek.api.dsl.it
import org.junit.Assert.assertEquals
import org.junit.platform.runner.JUnitPlatform
import org.junit.runner.RunWith
@RunWith(JUnitPlatform::class)
class ExampleUnitTest : Spek({
val x = 2
val y = 3
given("x = $x and y = $y") { …Run Code Online (Sandbox Code Playgroud) 我有八个视图鳍状肢,有4个问题和4个答案.只要单击特定的viewflipper,就会显示那些问题和答案.我的问题是,当第一次点击任何viewflipper时,当时无事可做,并且在点击viewflipper之后,下一个单击的viewflipper值想要检查哪个是相同的(相等).(如果Question是5 + 3那么答案应该是8).
条件:
如果我是第一次点击Q然后下次点击有Q的另一个viewflipper没有必要检查操作,没有任何隐藏.
如果我是第一次点击Q然后下次A点击Q的textview的reive值并检查它是否正确,如果它是正确隐藏Q和A.
如果我是第一次点击A然后下次Q点击A的textview的反向值并检查它是否正确,如果它是正确隐藏Q和A.
如果我是第一次点击A然后下次另一个点击了a的viewflipper没有任何检查操作是必要的,没有任何隐藏.
如果我第一次点击Q然后下次点击有Q的相同viewflipper没有任何检查操作是必要的隐藏.
如果我是第一次点击A然后下次相同的viewflipper点击A没有任何检查操作是必要的隐藏.
那么,如何检查当前可点击的ViewFlipper和之前点击的ViewFlipper.我不知道如何检查问题.
我想,看看这个,我的问题就更清楚了.

编辑:12月16日
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.vf1:
try {
if (click) {
Message msg = new Message();
msg.what = 1;
delayHandler.sendMessageDelayed(msg, DELAYTIME);
vFilpper1.showNext();
} catch (Exception e) {
e.printStackTrace();
}
counter++;
break;
case R.id.vf2:
try {
Message msg = new Message();
msg.what = 2;
delayHandler.sendMessageDelayed(msg, DELAYTIME);
Log.d("viewfilpper", "VFlipper 2");
vFilpper2.showNext();
} catch (Exception e) {
e.printStackTrace();
}
break;
case R.id.vf3:
try { …Run Code Online (Sandbox Code Playgroud) android ×9
java ×3
admob ×1
adview ×1
arraylist ×1
ioexception ×1
kotlin ×1
object ×1
spek ×1
textview ×1
viewflipper ×1
while-loop ×1