意图动作在隐式意图中不起作用吗?

时间:2018-12-19 20:35:05

标签: java android android-intent

Intent n = new Intent("com.bushraod.sendM.hom");
n.putExtra("name", nam);
startActivityForResult(n, 1);

我写了这段代码,转移到其他活动上无效。

3 个答案:

答案 0 :(得分:0)

要转到其他活动,请使用类似的内容。

Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra("name", name);
intent.setPackage("com.bushraod.sendM.hom"); //Package name of the application you are trying to open
startActivity(sendIntent);

答案 1 :(得分:0)

要导航到另一个活动,您可以执行以下操作:

Intent n = new Intent(this, ActivityThatYouWantToGoTo.class);
n.putExtra("dataThatYouWantToPass", data);
startActivity(n); 

答案 2 :(得分:0)

inputs = tf.keras.Input(shape=(32,))  # Returns a placeholder tensor

# A layer instance is callable on a tensor, and returns a tensor.
x = layers.Dense(64, activation='relu')(inputs)
x = layers.Dense(64, activation='relu')(x)
predictions = layers.Dense(10, activation='softmax')(x)

model = tf.keras.Model(inputs=inputs, outputs=predictions)

# The compile step specifies the training configuration.
model.compile(optimizer=tf.train.RMSPropOptimizer(0.001),
              loss='categorical_crossentropy',
              metrics=['accuracy'])

# Trains for 5 epochs
model.fit(data, labels, batch_size=32, epochs=100)

注意:请尝试此操作。