我在我的应用程序中使用WebView,我需要根据用户所在的页面更改应用程序标题.我怎样才能在Android WebView中执行此操作?
我通过以下方式在iphone中做到了这一点
self.title = [webPage stringByEvaluatingJavaScriptFromString:@"document.title"]
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Adds Progrss bar Support
this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
setContentView(R.layout.webview );
// Makes Progress bar Visible
getWindow().setFeatureInt( Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);
mWebView = (WebView) findViewById( R.id.webview ); //This is the id you gave
//to the WebView in the main.xml
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setSupportZoom(true); //Zoom Control on web (You don't need this
//if ROM supports Multi-Touch
mWebView.getSettings().setBuiltInZoomControls(true); //Enable Multitouch if supported by ROM
// Load URL
Bundle b = getIntent().getExtras();
String url = b.getString("url"); …Run Code Online (Sandbox Code Playgroud) 当我尝试导出我的android项目时,我收到以下eclipse错误消息"转换为Dalvik格式失败错误1"
我尝试以下步骤,但没有运气..
-Xms128m /-Xmx512m到eclipse.ini 导出步骤:
- 右键单击project-> export-> android下选择"导出android应用程序"
如何禁用 Jetpack Compose 中的后退按钮?我不希望用户返回到上一个屏幕。
我尝试了下面的代码,但用户仍然可以返回到上一个屏幕:
BackHandler(enabled = false) {
// do nothing
}
Run Code Online (Sandbox Code Playgroud) 我在构建项目时遇到了问题.第一次建立.我在代理服务器后面,所有其他依赖项只下载了这个有问题.
我在SO上尝试了一些选项,但到目前为止没有运气.有人能给我一个如何解决这个问题的线索吗?
到目前为止我尝试的事情:
File -> Invalidate Cache/Restart -> Invalidate and Restartcrashlytics:2.5.5@aar到crashlytics:2.6.4@aar app/build.gradle
buildscript {
repositories {
maven { url https://maven.fabric.io/public }
mavenCentral()
jcenter()
}
}
apply plugin: 'io.fabric'
dependencies {
compile("com.crashlytics.sdk.android:crashlytics:2.5.5@aar") {
transitive = true
}
}
Run Code Online (Sandbox Code Playgroud)
根 build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Run Code Online (Sandbox Code Playgroud)
错误:
Failed to list …Run Code Online (Sandbox Code Playgroud) 每次我执行Project - > Clean时,Maven控制台中都会显示以下错误.只有jar文件在目标文件夹中构建,apk文件没有构建.有谁可以帮我解决这个问题?
问候,
山姆.
我的发展环境是;
4/30/11 9:54:07 PM IST:[INFO]跳过不存在的resourceDirectory D:\ my\workspace\android\android-test-app\src\test\resources 4/30/11 9:54:07 PM IST:[INFO]未编译测试源4/30/11 9:54:07 PM IST:[INFO]测试被跳过.4/30/11 9:54:07 PM IST:[INFO] D:\ my\android-sdk-my\android-sdk-windows/platform-tools/dx.bat [--dex, - output = D :\ my\workspace\android\android-test-app\target\classes.dex,D:\ my\workspace\android\android-test-app\target\android-classes] 4/30/11 9:54:下午17点IST:[INFO] 4/30/11 9:54:17 PM IST:[INFO]麻烦处理"javax/xml/namespace/QName.class":4/30/11 9:54:17 PM IST: [INFO] 4/30/11 9:54:17 PM IST:[INFO]错误使用或错误使用核心类(java.*或javax.*)4/30/11 9:54:17 PM IST :[INFO]不构建核心库时.4/30/11 9:54:17 PM IST:[INFO] 4/30/11 9:54:17 PM IST:[INFO]这通常是由于无意中包含了一个核心库文件4/30/11 9: 54:17 PM IST:应用程序项目中的[INFO],使用IDE时(例如4/30/11 9:54:17 PM IST:[INFO] …
我正在尝试对齐表格行中的项目(左/中/右位置),但我可以点到它的工作可以有人帮我看下面的片段,,,
表行
应该对齐textview1 = left textview2 = center imgview1 = right
表行的xml
<?xml version="1.0" encoding="utf-8"?>
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/focast_day"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="left"
android:ellipsize="end"
android:maxLines="1"
android:scrollHorizontally="false"
android:singleLine="true"
android:text="@string/na_msg"
android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/focast_day_temp"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="center"
android:ellipsize="end"
android:maxLines="1"
android:scrollHorizontally="false"
android:singleLine="true"
android:text="@string/na_msg"
android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/focast_day_skyIcon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="right"
android:scrollHorizontally="false" />
</TableRow>
Run Code Online (Sandbox Code Playgroud)
myTableLayout
<TableLayout
android:id="@+id/weatherforcastTable"
android:layout_width="fill_parent"
android:stretchColumns="2"
android:layout_height="wrap_content"
android:layout_below="@+id/today_temp"
android:layout_centerHorizontal="true"
android:layout_marginTop="34dp" >
</TableLayout>
Run Code Online (Sandbox Code Playgroud)
用于将数据填充到表行的代码
for (Forecastday forecastday : forcastDayList) {
View view = inflater.inflate(R.layout.weather_forcast_day_view, null);
TextView focast_day …Run Code Online (Sandbox Code Playgroud) 我怎样才能将PNG图像读入NSImage.我尝试了以下方式,但是当我得到图像的宽度和大小时,我得到一些奇怪的价值......如果任何人可以指引我走正确的道路..非常合适..
NSImage * picture = [[NSImage alloc] initWithContentsOfFile: [bundleRoot stringByAppendingString:tString]];
NSLog(@"sixe %d %d",picture.size.width, picture.size.height);
if( picture ){
NSLog(@"Picture is not null");
}else {
NSLog(@"Picture is null.");
}
Run Code Online (Sandbox Code Playgroud)
谢谢
我有一个plist文件,其中有一些值与"&"唱歌,例如M&I,当我将文件保存到文档文件夹并加载它们时,我得到空的说法,任何想法如何解决这个问题.
当iPhone连接到无线路由器,并且该路由器未连接到互联网时?我需要显示一条错误消息,说"检查你的互联网连接"我试过Reachability示例代码.但没有运气, http://developer.apple.com/library/ios/#samplecode/Reachability/Listings/ReadMe_txt.html
当我在手机中禁用WIFI它工作正常时,我尝试在Objective C中检查互联网连接示例代码"isDataSourceAvailable"即使它没有工作,任何人都可以帮我解决这个问题,真的很适合.
我正在使用 android 分页库来显示搜索结果项,有什么方法可以清除/删除所有加载的结果项,在实时分页列表上调用 Invalidate 刷新列表未清除/删除项
In Activity:
fun clearSearchResult() {
if (productSearchResultItemAdapter.itemCount > 0) {
viewModel.invalidateResultList()
}
}
In ViewModel
private fun searchProductByTerm(searchTerm: String): Listing<Item> {
sourceFactory = ProductSearchItemDataSourceFactory(productSearchUC, compositeDisposable, searchTerm, resourceResolver)
val livePagedList = LivePagedListBuilder(sourceFactory, pagedListConfig)
//The executor used to fetch additional pages from the DataSource
.setFetchExecutor(getNetworkExecutor())
.build()
return Listing(
pagedList = livePagedList,
networkState = switchMap(sourceFactory.sourceLiveData) {
it.networkState
},
retry = {
sourceFactory.sourceLiveData.value?.retryAllFailed()
}
)
}
fun invalidateResultList() {
sourceFactory?.sourceLiveData?.value?.invalidate()
}
private val productSearchName = MutableLiveData<String>()
private val repoResult …Run Code Online (Sandbox Code Playgroud) android android-architecture-components android-paging-library
android ×6
eclipse ×2
iphone ×2
android-architecture-components ×1
cocoa ×1
crashlytics ×1
gradle ×1
ios ×1
maven ×1
networking ×1
nsimage ×1
objective-c ×1
plist ×1